Re: BUG #16154: pg_ctl restart with a logfile fails sometimes (on Windows) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16154: pg_ctl restart with a logfile fails sometimes (on Windows)
Date
Msg-id 23006.1576002250@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #16154: pg_ctl restart with a logfile fails sometimes (on Windows)  (Alexander Law <exclusion@gmail.com>)
Responses Re: BUG #16154: pg_ctl restart with a logfile fails sometimes (onWindows)
List pgsql-bugs
Alexander Law <exclusion@gmail.com> writes:
> 07.12.2019 22:26 Tom Lane <tgl@sss.pgh.pa.us>:
>> It seems like it'd be cleaner to fix both of these things at once
>> by opening the logfile ourselves (rather than letting CMD.EXE do it)
>> and using sharing-friendly parameters at that point.  But maybe it's
>> just not worth the trouble compared to the individual hacks.

> If we couldn't find more advantages of rewriting create process (with
> logfile), I would restrict changes to one hack (or two, if really needed).

Yeah, I agree that it doesn't yet seem worthwhile to do that sort of
rewrite.

Also, I realized that blaming CMD.EXE for holding the logfile open is
wrong: it's actually the postmaster itself that still has the file
open after it's removed postmaster.pid.  (Well, maybe CMD.EXE still
has a handle too, but that would be weird; and it's not necessary
to explain the problem.)  Short of doing our own redirection, the
only way to fix that would be for the postmaster to close its own
stdout and stderr before removing the pidfile, which is obviously
a bad idea.

Hence, I pushed this patch, with a revised comment.  We'll see
how it affects the buildfarm.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #16104: Invalid DSA Memory Alloc Request in Parallel Hash
Next
From: Tomas Vondra
Date:
Subject: Re: BUG #16104: Invalid DSA Memory Alloc Request in Parallel Hash