Re: Windows: Wrong error message at connection termination
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Lars Kanis <lars@greiz-reinsdorf.de>
Cc: pgsql-hackers@postgresql.org
Date: 2021-11-17T22:01:37Z
Lists: pgsql-hackers
Lars Kanis <lars@greiz-reinsdorf.de> writes: > Explicit closing the socket before process termination leads to a > graceful close even on Windows. That is done by the attached patch. I > think delivering the correct error message to the user is much more > important that closing the process in sync with the socket. Per the comment immediately above this, it's intentional that we don't close the socket. I'm not really convinced that this is an improvement. Can we get anywhere by using shutdown(2) instead of close(), ie do a half-close? I have no idea what Windows thinks the semantics of that are, but it might be worth trying. 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