From: Rainer Pruy <Rainer.Pruy@acrys.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: TCP Resets when closing connection opened via SSL
Date: Fri, 26 Apr 2019 10:19:48 +0200
Message-ID: <824d219b-e921-7d10-1711-51349f64611e@acrys.com> (raw)
In-Reply-To: <165ba87e-fa48-4eae-b1f3-f9a831b4890b@Spark>
References: <95b05f8d-990a-4f15-906f-24a011fc00ed@Spark>
<695f797f-b02b-492a-94d3-0d5b4ab7c0a2@Spark>
<165ba87e-fa48-4eae-b1f3-f9a831b4890b@Spark>
On 26.04.19 09:41, Jānis Pūris wrote:
> /Resending the original message without any formatting./
>
> Hello,
>
> I'm trying to do a simple health check for keepalived and other
> services via a python script and psycopg2 library. All seems to be all
> right, until I close the connection, at which point a packet with TCP
> reset is produced.
>
> This has become very problematic and creates extensive noise in
> monitoring.
>
> It also happens with IntelliJ DataGrip provided Java driver and PHP
> drivers. And hence I do not think this is the drivers problem, but PG
> instead.
> From PG side of things, all seems to be OK
>
What actual problem you are experiencing?
Usually, getting a TCP reset is a normal event on TCP connections not
necessarily related to any application level activity.
A TCP reset is triggered as soon as a packet is being received on a
"closed" connection.
Such "late orphaned packet" may e.g. result from an ack for a packet in
transit by the time of close.
For more detailed information you might look at the exact sequence of
packets being exchanged.
This way, you might get better insight in what is happening and better
information on wether something is going wrong.
That you do experience TCP reset only with SSL being involved might just
be accidentally or be a
consequence of SSL stack activities. It could even be caused by the way
the (SSL) connection
is being configured/set-up in the specific case.
But nevertheless, it might be perfectly OK for such packets to be generated.
So, please re-think why you are considering them problematic in the
first place.
Regards
Rainer
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: Rainer.Pruy@acrys.com
Subject: Re: TCP Resets when closing connection opened via SSL
In-Reply-To: <824d219b-e921-7d10-1711-51349f64611e@acrys.com>
References: <95b05f8d-990a-4f15-906f-24a011fc00ed@Spark> <695f797f-b02b-492a-94d3-0d5b4ab7c0a2@Spark> <165ba87e-fa48-4eae-b1f3-f9a831b4890b@Spark> <824d219b-e921-7d10-1711-51349f64611e@acrys.com>
* 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