Re: [Question]What will happen if the server active close the connection?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Wen Yi <896634148(at)qq(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: [Question]What will happen if the server active close the connection?
Date: 2023-06-05 07:27:12
Message-ID: ae92b173bc848d68bb178886518ca8489e3c4993.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Kohll 2023-06-05 07:45:50 Re: Is there any good optimization solution to improve the query efficiency?
Previous Message gzh 2023-06-05 06:56:44 Is there any good optimization solution to improve the query efficiency?