model-writtenrun 1156 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jianghua Yang submitted #1 to check dup() failures independently and close duplicated descriptors when fdopen() or gzdopen() fails in pg_dump's gzip, lz4, zstd, and uncompressed backends, including cleanup of allocated zstd state.
- Tom Lane pointed out in #2 that callers exit immediately on failure, making the descriptor leak insufficient grounds for backpatching.
- Jianghua Yang agreed in #3, but explained that checking dup() directly also preserves useful errors such as EMFILE instead of letting fdopen() replace them with EBADF.
- Tom Lane accepted that diagnostic benefit in #4 and chose to apply the fix only to HEAD because the failure case was unlikely.
- Tom Lane committed #1 unchanged as 8b02c22bb4, reported finding no other instances of the problematic pattern in #5, and received Jianghua Yang's acknowledgment in #6, closing the thread with the fix landed and no backpatch planned.