Re: Connection terminated but client didn't realise

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Wheeler <dwheeler(at)dgitsystems(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, Orapan Sanghirunyaplute <orapans(at)dgitsystems(dot)com>, Ross Dougherty <rdougherty(at)dgitsystems(dot)com>
Subject: Re: Connection terminated but client didn't realise
Date: 2019-12-02 15:17:04
Message-ID: 30006.1575299824@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Wheeler <dwheeler(at)dgitsystems(dot)com> writes:
> We have a query that our system runs nightly to refresh materialised views. This takes some time to execute (~25 minutes) and then it will usually return the results to the application and everything is golden. However occasionally we see something like the below, where the query finishes, but the connection gets unexpectedly closed from Postgres’ perspective. From the application’s perspective the connection is still alive, and it sits there forever waiting for the result.

Is the application remote from the database server? My gut reaction
to this type of report is "something timed out the network connection",
but there would have to be a router or firewall or the like in between
to make that a tenable explanation.

If that is the issue, you should be able to fix it by making the
server's TCP keepalive settings more aggressive.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Steele 2019-12-02 15:27:05 Re: pgbackrest concerns and doubts.
Previous Message Alban Hertroys 2019-12-02 12:08:01 Re: Conditional return of aggregated data