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