model-writtenrun 7190 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Thomas Munro opened the thread after standby catch-up tests intermittently timed out, mostly on Windows buildfarm machines, in #1.
- Tom Lane traced the failures to standbys missing primary disconnection after a restart and linked their onset to the recent Windows graceful-shutdown changes in #3 and #4.
- Alexander Lakhin reproduced the hang inside WaitForMultipleObjects and demonstrated that a WSAPoll EOF check avoided it in #5, prompting Thomas to investigate whether FD_CLOSE was reported only once in #7.
- Thomas first added sticky FD_CLOSE tracking in #8, but Alexander showed that temporary WaitEventSets discarded that state in #9; Thomas then added a persistent walreceiver WaitEventSet in #11, which passed Alexander's 100 test iterations in #12.
- Andrew Dunstan and Tom separated unrelated historical failures from the Windows regression in #14 and #15, with Tom also questioning whether catch-up helpers should depend on statistics-collector updates.
- Alexander demonstrated the same hang in postgres_fdw and verified that removing shutdown and closesocket avoided it in #16, showing that a walreceiver-only fix was insufficient.
- Thomas proposed a general latch.c fix using an initial WSAPoll check followed by remembered EOF state in #20; Alexander reported successful repeated commit_ts, FDW, and recovery tests, including Windows Unix-domain sockets, in #23.
- Thomas and Andres identified additional ways to lose socket events in #22 and #24, including WSAEventSelect clearing pending event records, which weakened confidence in the limited polling workaround.
- Andres independently supplied a persistent-WaitEventSet patch covering physical and logical replication in #28, acknowledged its similarity to Thomas's earlier work in #32, and raised the separate problem of indefinite waits bypassing wal_receiver_timeout.
- Alexander found that Andres's persistent-set patch still hung without sticky closure tracking in #33, reinforcing that extending event-set lifetime alone was insufficient.
- With a minor release approaching, Andres requested a rollback in #34, Thomas recommended limiting it to stable branches in #37, and Tom accepted in #38; 645c9457f2 implemented that discussion directly.
- Thomas replaced the earlier approaches with socket-owned event handles and a hash table in #39, adding libpq lifecycle callbacks and non-throwing simplehash allocation while separating Windows correctness from future persistent-WaitEventSet performance work.
- Andres reviewed the new design and suggested tracking additional readiness events in #40; Thomas agreed to explore socket wrappers and broader event tracking in #41.
- The hangs discussed here motivated Andres's Windows CI timeout mitigation in 6dcc185266, which preserves debugging output when tests hang; the implementation originated in thread #44909, where its separate push was announced in #498305.
- A separate PQisBusy hypothesis did not resolve the hang: Alexander supplied diagnostic instrumentation and failure results in #43, after which Tom proposed consuming input before waiting in #44 and Andres supported that ordering while questioning blocking reads in #45.
- Noah Misch revisited the separate statistics-dependent catch-up concern in #46, suggesting either independent monitoring or periodic WAL activity to recover from missed statistics updates.
- Thomas concluded that the larger socket abstraction fix was not ready for PostgreSQL 15 in #47 and approved reverting HEAD in #49; Tom committed 29992a6a50 and confirmed completion in #50.
- After a long gap, Thomas revived the work in #51 with reference-counted socket event handles, level-triggered readiness tracking, simplehash changes, legacy-wait cleanup, and proposed restoration of graceful shutdown, deferring more extensive WSAPoll or asynchronous-I/O redesigns.
- Alexander assembled historical socket-failure tests in #52 and confirmed that the new series fixed the standby and FDW hangs, but reported remaining lost-error-message cases, intermittent SSL failures, and a separate walsender shutdown problem.
- Robert Haas questioned the necessity and allocation-failure semantics of the simplehash changes in #53; after a CI-failure reminder in #54, the unresolved redesign was marked Returned with Feedback in #55, with no landing of that series shown in this thread.