In AtEOXact_Files, complain if any files remain unclosed at commit.
Tom Lane <tgl@sss.pgh.pa.us>
In AtEOXact_Files, complain if any files remain unclosed at commit. This change makes this module act more like most of our other low-level resource management modules. It's a caller error if something is not explicitly closed by the end of a successful transaction, so issue a WARNING about it. This would not actually have caught the file leak bug fixed in commit 231bcd080, because that was in a transaction-abort path; but it still seems like a good, and pretty cheap, cross-check. Discussion: https://postgr.es/m/152056616579.4966.583293218357089052@wrigleys.postgresql.org
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/xact.c | modified | +3 −3 |
| src/backend/postmaster/autovacuum.c | modified | +1 −1 |
| src/backend/postmaster/bgwriter.c | modified | +1 −1 |
| src/backend/postmaster/checkpointer.c | modified | +1 −1 |
| src/backend/postmaster/walwriter.c | modified | +1 −1 |
| src/backend/storage/file/fd.c | modified | +21 −11 |
| src/include/storage/fd.h | modified | +1 −1 |
Discussion
- BUG #15105: OpenTransientFile() should be paired with CloseTransientFile() rather than close() 5 messages · 2018-03-09 → 2018-04-11