model-writtenrun 4561 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Lucas DRAESCHER reported that backend crash restarts accumulated io_uring file descriptors and proposed a method-local on_shmem_exit() callback to release the old instances #1.
- ChangAo Chen reproduced the bug, confirmed the fix and postmaster-only callback execution, and suggested a generic cleanup interface #2; Lucas implemented IoMethodOps.shmem_cleanup while questioning whether a single implementor justified the abstraction #3.
- Lucas rebased the interface-based implementation onto the new shared-memory API #4; Ilmar Yunusov and Lætitia Avrot reported successful tests and stable descriptor counts across crashes, with Lætitia favoring the generic interface and flagging callback ordering for confirmation #5 #6, and Lucas accepted that design #8.
- Fujii Masao raised the ABI implications for backpatching #9, while Jakub Wartak demonstrated that leaked rings could prevent crash recovery and requested a postmaster assertion #10; Lucas added the assertion, clarified the version history, and acknowledged that PostgreSQL 18 would need a different backpatch #12.
- After Jakub verified the updated patch and requested clearer wording about crash-recovery failures #13, Fujii supplied revised patches based on the original method-local design, avoiding the ABI change and proposing that any common cleanup interface be considered separately #14.
- Jakub tested the revised fix on master and PostgreSQL 18 and confirmed that the leaks disappeared #15; Xuneng Zhou also verified it, but reported that corrupted shared-memory descriptors could cause cleanup to close an unrelated listening socket and proposed postmaster-local copies #16.
- Fujii chose to handle the shared-memory corruption concern separately #17 and committed #14 unchanged as 953c6dabdb, with backports through PostgreSQL 18, announcing the push in #18.
- Fujii then submitted a follow-up that stores ring descriptors and the value referenced by sq.kring_entries in postmaster-local memory, while questioning whether relying on liburing implementation details made this approach too fragile #21.
- At the thread's end, the descriptor-leak fix had landed but the corruption-hardening follow-up remained under discussion: Xuneng agreed about its fragility, suggested consulting liburing's maintainer, and outlined direct descriptor closing as a possible alternative for rings using caller-provided memory #22.