Re: BUG #15443: Connection loss error come occasionally - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15443: Connection loss error come occasionally
Date
Msg-id 8896.1540050925@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #15443: Connection loss error come occasionally  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-bugs
Jeff Janes <jeff.janes@gmail.com> writes:
> On Fri, Oct 19, 2018 at 6:39 AM PG Bug reporting form <
> noreply@postgresql.org> wrote:
>> org.postgresql.util.PSQLException: An I/O error occurred while sending to
>> the backend.
>> Caused by: java.net.SocketException: Connection reset by peer: socket write
>> error

> Probably a firewall or gateway dropping the connections that they perceive
> as being idle.

Yeah, that's what it looks like to me too.

> Seems like your application should be designed to recover from this without
> a full restart.

That's not a bad idea, but you can probably also alleviate the problem
by enabling TCP keepalives on the connection.  PG has both server-side
and client-side (at least in libpq) options for that.  Should be
sufficient to turn it on at just one end.

            regards, tom lane


pgsql-bugs by date:

Previous
From: Jeff Janes
Date:
Subject: Re: BUG #15443: Connection loss error come occasionally
Next
From: Jeff Frost
Date:
Subject: Re: psql on Mac