We are having intermittent problems when connecting to PostgreSQL that we are having a hard time resolving. This is an example from the log file in our application:
CoreLab.PostgreSql.PgSqlException: Write failure ---> System.Net.Sockets.SocketE
xception: The socket has been shut down
at System.Net.Sockets.Socket.Send (System.Byte[] buf, Int32 offset, Int32 size
, SocketFlags flags) [0x00000]
at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, Int32 offset,
Int32 size) [0x00000] --- End of inner exception stack trace ---
at CoreLab.PostgreSql.o.b (System.Byte[] A_0, Int32 A_1, Int32 A_2) [0x00000]
at CoreLab.PostgreSql.o.j () [0x00000]
at CoreLab.PostgreSql.a.a (System.String A_0, System.String A_1) [0x00000]
at CoreLab.PostgreSql.a.l () [0x00000]
at CoreLab.PostgreSql.PgSqlCommand.a (Boolean A_0, Int32 A_1, Int32 A_2) [0x00
000]
This is occurring with version 3.20.16.0 of the PostgreSQLDirect.NET driver accessing PostgreSQL 8.1.10 running on CentOS 5. Our application is running under mono-1.2.5 on CentOS 5 as well.
Interestingly, if this error occurs several times in row it can also generate an 'out of memory' exception from mono itself.
What are the common causes for this problem? We have not found anything unusual with the settings for PostgreSQL or by reviewing the PostgreSQL log file. The network settings appear to be normal as well..
Any help or insight would be greatly appreciated.