pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: On Windows, close the client socket explicitly during backend sh
Date: Thu, 02 Dec 2021 22:15:34 +0000
Message-ID: <E1msuMY-0000En-M5@gemulon.postgresql.org> (raw)

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_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6251f86241acd05facefc4b4caacc9430b059d58

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



view thread (6+ messages)  latest in thread

Message-ID: <E1msuMY-0000En-M5@gemulon.postgresql.org>
Permalink:  ../E1msuMY-0000En-M5@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1msuMY-0000En-M5@gemulon.postgresql.org

 · 

reply

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: On Windows, close the client socket explicitly during backend sh
  In-Reply-To: <E1msuMY-0000En-M5@gemulon.postgresql.org>
  References: <E1msuMY-0000En-M5@gemulon.postgresql.org>

* 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