[Dev] PostgreSQL connection timeout

Richard O. Hammer ROHammer at EarthLink.net
Tue Jan 13 18:10:22 EST 2004


I have PostgreSQL 7.3.2 running on Red Hat 7.3, and I am connecting to 
it from a Java Virtual Machine on Windows 2000.  Usually it runs fine. 
   But sometimes it breaks, seemingly with a connection timeout.  I 
hope for suggestions on what to do about this.

When my problem happens, I get a stack trace like this on the client 
(Windows) side:

An I/O error occurred while reading from backend - Exception: 
java.net.SocketException: Connection reset by peer: JVM_recv in socket 
input stream read
Stack Trace:

java.net.SocketException: Connection reset by peer: JVM_recv in socket 
input stream read
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.read(SocketInputStream.java:116)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
	at org.postgresql.PG_Stream.ReceiveChar(PG_Stream.java:138)
	at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:71)
...


And on the Linux server side I see the following message in
/var/log/messages.  I believe this message relates to the problem I am 
having.

Jan 10 22:54:59 r postgres[27572]: [1] LOG:  pq_recvbuf: recv() 
failed: Connection timed out

Searching, I found my error message mentioned on one PostgreSQL email 
list.  The reply given there told that this is not a PostgreSQL 
problem, but an underlying kernel or TCP thing on Linux.

So, I don't know what to ask exactly, but is there a default TCP 
connection timeout on Linux?  that I could maybe set?

Thanks,
Rich Hammer



More information about the Dev mailing list