pgsql: On Windows, close the client socket explicitly during backend sh

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: On Windows, close the client socket explicitly during backend sh
Date: 2021-12-02 22:15:34
Message-ID: E1msuMY-0000Ek-Li@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Windows, close the client socket explicitly during backend shutdown.

It turns out that this is necessary to keep Winsock from dropping any
not-yet-sent data, such as an error message explaining the reason for
process termination. It's pretty weird that the implicit close done
by the kernel acts differently from an explicit close, but it's hard
to argue with experimental results.

Independently submitted by Alexander Lakhin and Lars Kanis (comments
by me, though). Back-patch to all supported branches.

Discussion: https://postgr.es/m/90b34057-4176-7bb0-0dbb-9822a5f6425b@greiz-reinsdorf.de
Discussion: https://postgr.es/m/16678-253e48d34dc0c376@postgresql.org

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4cd2928543c1148278f8c1f393ee58dd72816df0

Modified Files
--------------
src/backend/libpq/pqcomm.c | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2021-12-02 22:34:06 Re: pgsql: Add TAP tests for contrib/sslinfo
Previous Message Andres Freund 2021-12-02 21:21:12 Re: pgsql: Add TAP tests for contrib/sslinfo