From: Tom Lane <tgl@sss.pgh.pa.us>
To: Argha Deep Ghoshal <ghoshal.arghadeep@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: PSQLException: An I/O error occurred while sending to the backend.
Date: Thu, 30 Jul 2020 10:26:45 -0400
Message-ID: <1386310.1596119205@sss.pgh.pa.us> (raw)
In-Reply-To: <CAPJci=MY99uk3aQG=NkyzuN_QcfVswrYfVE=b_s5bpGws14ZpQ@mail.gmail.com>
References: <CAPJci=MY99uk3aQG=NkyzuN_QcfVswrYfVE=b_s5bpGws14ZpQ@mail.gmail.com>
Argha Deep Ghoshal <ghoshal.arghadeep@gmail.com> writes:
> We are using PostgreSQL 11 wherein intermittently the below exception is
> popping up, causing our application to lose connection with the database.
> It isn't reconnecting until the application is restarted.
> org.postgresql.util.PSQLException: An I/O error occurred while sending
> to the backend.
That certainly looks like loss of network connection. Had the connection
been sitting idle for awhile before this query attempt?
> We have checked the PostgreSQL logs in detail, however we are unable to
> find any significant errors related to this issue.
I'd expect that the backend would eventually notice the dead connection.
But the timeout before it does so might be completely different from the
time at which the client notices the dead connection, so the relationship
might not be very obvious.
> All the servers are present in the same region and building.
Doesn't mean there's not routers or firewalls between them. I'd start
by looking for network timeouts, and possibly configuring the server
to send TCP keepalives more aggressively. (In this case it might be
HAProxy that needs to be sending keepalives ... don't know what options
it has for that.)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, ghoshal.arghadeep@gmail.com
Subject: Re: PSQLException: An I/O error occurred while sending to the backend.
In-Reply-To: <1386310.1596119205@sss.pgh.pa.us>
References: <CAPJci=MY99uk3aQG=NkyzuN_QcfVswrYfVE=b_s5bpGws14ZpQ@mail.gmail.com> <1386310.1596119205@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox