pg_test_fsync file descriptor leak

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_test_fsync file descriptor leak
Date: 2014-11-18 20:41:28
Message-ID: CAMkU=1w4At93+pF2q6Jr2wTHGK808J1+J9ZhT6+NbzeJ8ua52A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
pg_test_fsync_leak.patch application/octet-stream 511 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2014-11-18 21:11:48 Re: proposal: plpgsql - Assert statement
Previous Message Jim Nasby 2014-11-18 20:32:34 Re: 9.5: Better memory accounting, towards memory-bounded HashAgg