Replace opendir/closedir calls throughout the backend with AllocateDir
and FreeDir routines modeled on the existing AllocateFile/FreeFile. Like the latter, these routines will avoid failing on EMFILE/ENFILE conditions whenever possible, and will prevent leakage of directory descriptors if an elog() occurs while one is open. Also, reduce PANIC to ERROR in MoveOfflineLogs() --- this is not critical code and there is no reason to force a DB restart on failure. All per recent trouble report from Olivier Hubaut.
Showing
- contrib/dbsize/dbsize.c 3 additions, 4 deletionscontrib/dbsize/dbsize.c
- src/backend/access/transam/slru.c 3 additions, 5 deletionssrc/backend/access/transam/slru.c
- src/backend/access/transam/xlog.c 5 additions, 7 deletionssrc/backend/access/transam/xlog.c
- src/backend/storage/file/fd.c 109 additions, 17 deletionssrc/backend/storage/file/fd.c
- src/include/storage/fd.h 12 additions, 2 deletionssrc/include/storage/fd.h
- src/port/copydir.c 6 additions, 6 deletionssrc/port/copydir.c
Loading
Please register or sign in to comment