Re: [Question]What will happen if the server active close the connection? - Mailing list pgsql-general

From Laurenz Albe
Subject Re: [Question]What will happen if the server active close the connection?
Date
Msg-id ae92b173bc848d68bb178886518ca8489e3c4993.camel@cybertec.at
Whole thread Raw
In response to [Question]What will happen if the server active close the connection?  ("Wen Yi" <896634148@qq.com>)
List pgsql-general
On Mon, 2023-06-05 at 10:18 +0800, Wen Yi wrote:
> when I study the tcp connection, I found that if the server active close the connection,
> the server will send a fin package to the client and the client will reply a ack package.
> As this:
>
> Server ---->(FIN) Client
> Server <----(ACK) Client
>
> My question is, in so many articles, the following step is, the client will write some
> data(send some data) to the server and then cause the signal SIGNALPIPE.
> But what will happen if the client died?(Example: was killed by the user)

If the server has already closed the connection, nothing much will happen.
If the client never sends ACK to the FIN, the session will still time out.

You can fiddle with the tcp_keepalives_* parameters to influence that.

Yours,
Laurenz Albe



pgsql-general by date:

Previous
From: gzh
Date:
Subject: Is there any good optimization solution to improve the query efficiency?
Next
From: Oliver Kohll
Date:
Subject: Re: Is there any good optimization solution to improve the query efficiency?