| From: | Andrey Borodin <x4mmm(at)yandex-team(dot)ru> |
|---|---|
| To: | Michael Paquier <michael(at)paquier(dot)xyz> |
| Cc: | Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers mailing list <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: injection_points: canceled or terminated waiters leak their wait slots |
| Date: | 2026-08-23 09:13:27 |
| Message-ID: | 088AB35D-0860-494A-A9CF-8B301543AA51@yandex-team.ru |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> On 23 Jul 2026, at 08:40, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> done
Hi,
While running CI for an unrelated patch, I saw wait_cleanup fail in the
Windows Visual Studio job[0].
The server log contains the expected FATAL, but isolationtester only saw:
PQconsumeInput failed: server closed the connection unexpectedly
It then exited without running the rest of the permutation or teardown, so
heap_lock_update failed afterwards because the injection_points extension
still existed.
This seems to be another instance of the known Windows behavior where the
last server message can be lost when a connection is closed [1]. The test
added in a49b6a61094 intentionally terminates an isolationtester connection,
so it is exposed to that behavior.
The attached patch makes isolationtester treat PQconsumeInput() failure with
CONNECTION_BAD as completion of the step. It reports any complete server
error already buffered by libpq, followed by the saved connection error, and
the rest of the test and teardown can run. Other PQconsumeInput() failures
remain fatal. An alternative expected file covers the case where Windows
loses the server's FATAL and only the libpq-generated connection error
remains.
The alternative output is synthetic. I tested it by temporarily suppressing
the final ErrorResponse while leaving backend termination unchanged. The
output then matched wait_cleanup_1.out. With normal error delivery it matched
wait_cleanup.out. If anyone knows a way to reproduce the actual Windows
message loss on demand, that would be useful. Otherwise, the next occurrence
in CI with this patch applied will give us an output to compare with the
alternative file.
The injection_points isolation tests pass through Windows CI.
If I have misdiagnosed the cause of this CI failure, apologies for the noise.
Best regards, Andrey Borodin.
[0] https://github.com/x4m/postgres_g/actions/runs/32582921356/job/97055012805
[1] https://postgr.es/m/CA%2BhUKGLR10ZqRCvdoRrkQusq75wF5%3DvEetRSs2_u1s%2BFAUosFQ%40mail.gmail.com
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0001-Let-isolationtester-report-connection-loss-as-a-s.patch | application/octet-stream | 5.5 KB |
| From | Date | Subject | |
|---|---|---|---|
| Previous Message | Taha Naveed | 2026-08-23 08:41:50 | Re: PGQ catalog representation and pg_dump support |