Re: BUG #15443: Connection loss error come occasionally

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: sagar5490(dot)more(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15443: Connection loss error come occasionally
Date: 2018-10-20 15:55:25
Message-ID: 8896.1540050925@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Jeff Janes <jeff(dot)janes(at)gmail(dot)com> writes:
> On Fri, Oct 19, 2018 at 6:39 AM PG Bug reporting form <
> noreply(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Jeff Frost 2018-10-20 20:46:29 Re: psql on Mac
Previous Message Jeff Janes 2018-10-20 14:08:22 Re: BUG #15443: Connection loss error come occasionally