pg_test_fsync file descriptor leak - Mailing list pgsql-hackers

From Jeff Janes
Subject pg_test_fsync file descriptor leak
Date
Msg-id CAMkU=1w4At93+pF2q6Jr2wTHGK808J1+J9ZhT6+NbzeJ8ua52A@mail.gmail.com
Whole thread Raw
Responses Re: pg_test_fsync file descriptor leak  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
The open_datasync code opens the output file as a test to make sure the flags are accepted by the OS, and if it succeeds it then immediately opens the file again with the same flags, overwriting and so leaking the descriptor from the previous open.


On Windows MinGW, this prevents the final unlink from working, as the file is still open.

Trivial fix attached.

Thanks,

Jeff


Attachment

pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: 9.5: Better memory accounting, towards memory-bounded HashAgg
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: plpgsql - Assert statement