model-writtenrun 4776 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Thomas Munro proposed replacing the postmaster's select()-and-signal-handler architecture with WaitEventSet, pending flags, and a shared latch in #1, aiming to simplify control flow and use modern platform waiting APIs.
- Andres Freund explained that corrupting a shared latch's owner information could prevent reliable postmaster wakeups in #2; Thomas accepted the separation in #3 and used a process-local latch with existing SIGUSR1 notifications in #4, deferring robust shared-latch signaling.
- Thomas traced unreaped children to the PM_WAIT_DEAD_END sleep loop and replaced it with latch waiting in #5, temporarily suppressing socket events so pending connections would not cause a busy loop.
- Andres's detailed review in #6 led Thomas to split prerequisites, remove the nearly empty Postmaster structure, prioritize shutdown and child-exit processing, centralize fork signal masking, and add inherited wait-set cleanup in #7.
- Andres suggested recreating the WaitEventSet in #8, allowing Thomas to drop the socket-suppression API patch in #10; Justin Pryzby's comment correction in #9 was also incorporated, and #13 fixed an accidental compilation-breaking typo.
- The three prerequisites from #13 landed with unchanged code as 30829e52ff for socket acceptance, 1f0019de2f for inherited signalfd cleanup, and b5d0f8ec01 for freeing inherited WaitEventSets; Thomas posted the remaining postmaster patch in #14.
- Thomas revisited error handling, signal safety, and competing shutdown requests in #15; Andres identified the risk of downgrading shutdown requests and proposed separate flags in #16, which Thomas implemented with strongest-request priority and dynamic wait-set sizing in #17.
- Thomas retained the existing policy of servicing returned connection events before checking newly arriving signals in #17, leaving more responsive per-connection signal checks for possible later work.
- Andres endorsed the overall approach and requested removal of unnecessary timeval conversions in #18; Thomas corrected shutdown-flag clearing, adopted pm-qualified names, and supplied the timing refactor as a separate patch in #19.
- The main event-loop patch from #19 landed as 7389aad636 with comment updates and small resource-pointer and shutdown-flag adjustments, while its timing refactor landed as 5a26c7b310 with a redundant clamp removed; Thomas announced the landing in #20.
- Tom Lane reported a buildfarm Valgrind failure in #21, and Thomas reproduced it in #22: the newly dynamic wait-set allocation exposed an existing mismatch between internal event-buffer capacity and the count passed to epoll_wait() or kevent().
- Thomas's buffer-capacity fix in #23 stopped the Valgrind complaint, Andres endorsed backpatching in #24, and the unchanged fix landed as f1821b58fc with stable-branch backports confirmed in #25.
- Thomas proposed removing now-unnecessary volatile qualifiers from five postmaster flags in #26; Tom Lane and Andres approved in #27 and #28, and the unchanged cleanup landed as 8d2c1913ed shortly after the final message, completing all submitted work retained in this thread.