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-18T02:04:00Z
Lists: pgsql-hackers
Thomas Munro <thomas.munro@gmail.com> writes: > I realise now that the experiments we did a while back to try to > understand this across a few different operating systems[2] had missed > this subtlety, because that Python script had an explicit close() > call, whereas PostgreSQL exits. It still revealed that the client > isn't allowed to read any data after its write failed, which is a > known source of error messages being eaten. Yeah. After re-reading that thread, I'm a bit confused about how to square the results we got then with Lars' report. The Windows documentation he pointed to does claim that the default behavior if you issue closesocket() is to do a "graceful close in the background", which one would think means allowing sent data to be received. That's not what we saw. It's possible that we would get different results if we re-tested with a scenario where the client doesn't attempt to send data after the server-side close; but I'm not sure how much it's worth to improve that case if the other case still fails hard. In any case, our previous results definitely show that issuing an explicit close() is no panacea. 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