Re: Windows: Wrong error message at connection termination
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Lars Kanis <lars@greiz-reinsdorf.de>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-11-17T22:55:53Z
Lists: pgsql-hackers
Thomas Munro <thomas.munro@gmail.com> writes: > Interesting discovery. I think you might get the same behaviour from > a Unix system if you set SO_LINGER to 0 before you exit[1]. I suppose > if a TCP implementation is partially in user space (I have no idea if > this is true for Windows, I never use it, but I recall that Winsock > was at some point a DLL) and can't handle the existence of any socket > state after the process is gone, you might want to nuke everything and > tell the peer immediately that you're doing so on exit? It's definitely plausible that Windows does this because it can't handle retransmits once the sender's state is gone. However, it seems to me that any such state would be tied to the open socket, not to the sender process as such. Which would suggest that an early close() as Lars suggests would make things worse not better. This is all just speculation unfortunately. (Man, I hate dealing with closed-source software.) regards, tom lane
Commits
-
On Windows, close the client socket explicitly during backend shutdown.
- 00cd81723cd0 10.20 landed
- a87c8c3edd7f 11.15 landed
- 3e644dcca1e9 12.10 landed
- 6251f86241ac 13.6 landed
- 4cd2928543c1 14.2 landed
- 6051857fc953 15.0 landed