model-writtenrun 8765 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- The thread opened with Thomas Munro's announcement that kqueue support had landed for the WaitEventSet API on BSD systems and macOS #1.
- Michael Paquier reported postgres_fdw regression failures on NetBSD caused by kqueue exhausting file descriptors, and Tom Lane reproduced the failure with a 128-descriptor limit, identifying unsafe allocation and potential leakage in both kqueue and epoll WaitEventSets #2 #6 #7.
- Munro proposed reducing temporary WaitEventSet creation through separate work on a common long-lived set and pointed to existing resource-owner cleanup work; Lane's investigation instead established that uncounted long-lived descriptors were consuming almost the entire reserved allowance, including on Linux #8 #10.
- Lane proposed explicitly counting externally managed descriptors so fd.c could close virtual files to preserve spare capacity, then posted a patch covering core backend descriptors and postgres_fdw that passed check-world under the lowest supported descriptor limit #11 #12.
- Lane revised the patch to separate fallible acquisition from unconditional reservation and added dblink accounting, while leaving the broader WaitEventSet lifecycle redesign outside this patch #12 #13.
- Munro identified that the new postgres_fdw limit could produce misleading errors; Herrera suggested identifying the local server and tailoring hints by platform, which Lane incorporated into the final diagnostics #15 #20 #24.
- Mark Dilger proposed procedural-language wrappers for descriptor accounting, but Lane deferred that integration until there was demonstrated demand; Andres Freund's alternative of reserving actual descriptors with dup() was discussed without adoption #17 #18 #19.
- Freund and Herrera also discussed raising operating-system descriptor limits automatically, but Lane preferred preserving administrator control on Unix, leaving automatic limit adjustment outside the committed work #22 #23 #25 #26 #27 #28.
- Lane committed the revised accounting patch from #13 as 3d475515a1, adding the agreed diagnostics and raising the configuration minimum to 64; the commit deliberately avoided backpatching because of the risk and absence of field complaints.
- Alexander Korotkov subsequently reported backends exiting during lock waits under lldb on macOS; Munro reproduced the problem and traced it to getppid() returning the debugger's PID, falsely triggering the postmaster-death check #29 #30.
- After Herrera recalled related historical behavior, Munro posted an inline fix that retained the fast parent-PID check but confirmed death through the monitoring pipe, then committed it with a wrapper-call adjustment as 7bc84a1f30 #31 #32 #33.
- The thread ended with a separate unresolved hang on an old macOS buildfarm animal: Lane suspected a missed input event, Munro investigated possible historical kqueue kernel bugs, and Rémi Zara could not access another old Mac to corroborate the behavior, so both candidate fixes had landed but this later failure remained open #34 #35 #36.