Re: Windows: Wrong error message at connection termination - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Windows: Wrong error message at connection termination
Date
Msg-id 1283317.1638213407@sss.pgh.pa.us
Whole thread Raw
In response to Re: Windows: Wrong error message at connection termination  (Alexander Lakhin <exclusion@gmail.com>)
Responses Re: Windows: Wrong error message at connection termination
List pgsql-hackers
Alexander Lakhin <exclusion@gmail.com> writes:
> 27.11.2021 14:39, Lars Kanis wrote:
>> So I still think it's best to close the socket as proposed in the patch.

> Please see also the previous discussion of the topic:
> https://www.postgresql.org/message-id/flat/16678-253e48d34dc0c376%40postgresql.org

Hm, yeah, that discussion seems to have slipped through the cracks.
Not sure why it didn't end up in pushing something.

After re-reading that thread and re-studying relevant Windows
documentation [1][2], I think the main open question is whether
we need to issue shutdown() or not, and if so, whether to use
SD_BOTH or just SD_SEND.  I'm inclined to prefer not calling
shutdown(), because [1] is self-contradictory as to whether it
can block, and [2] is pretty explicit that it's not necessary.

            regards, tom lane

[1] https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-shutdown
[2] https://docs.microsoft.com/en-us/windows/win32/winsock/graceful-shutdown-linger-options-and-socket-closure-2



pgsql-hackers by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: Lots of memory allocated when reassigning Large Objects
Next
From: Jeff Davis
Date:
Subject: Re: Non-superuser subscription owners