Alexander Lakhin <exclus...@gmail.com> writes: > 09.01.2022 04:17, Tom Lane wrote: >> ... wait a minute. After some more study of the buildfarm logs, >> it was brought home to me that these failures started happening >> just after 6051857fc went in:
> I've managed to reproduce this failure too. > Removing "shutdown(MyProcPort->sock, SD_SEND);" doesn't help here, so > the culprit is exactly "closesocket(MyProcPort->sock);". Ugh. Did you try removing the closesocket and keeping shutdown? I don't recall if we tried that combination before. > ... I'm not sure where to > place this check, maybe it's better to move it up to > libpqrcv_PQgetResult() to minimize it's footprint or to find less > Windows-specific approach, but I'd prefer a client-side fix anyway, as > graceful closing a socket by a server seems a legitimate action. What concerns me here is whether this implies that other clients (libpq, jdbc, etc) are going to need changes as well. Maybe libpq is okay, because we've not seen failures of the isolation tests that use pg_cancel_backend(), but still it's worrisome. I'm not entirely sure whether the isolationtester would notice that a connection that should have died didn't. regards, tom lane