Re: pg_test_fsync file descriptor leak

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_test_fsync file descriptor leak
Date: 2014-11-19 17:31:49
Message-ID: CA+TgmobQcSSms=3QsbhpERriHL26eb0wJ3m6FEs0S-0v3sLzzw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 18, 2014 at 3:41 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> 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.

Committed and back-patched to 9.1. Thanks.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-11-19 17:33:58 Re: Doing better at HINTing an appropriate column within errorMissingColumn()
Previous Message Andres Freund 2014-11-19 17:20:58 Re: What exactly is our CRC algorithm?