Re: BUG #16154: pg_ctl restart with a logfile fails sometimes (on Windows)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Law <exclusion(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #16154: pg_ctl restart with a logfile fails sometimes (on Windows)
Date: 2019-12-10 18:24:10
Message-ID: 23006.1576002250@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Alexander Law <exclusion(at)gmail(dot)com> writes:
> 07.12.2019 22:26 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tomas Vondra 2019-12-10 18:36:06 Re: BUG #16104: Invalid DSA Memory Alloc Request in Parallel Hash
Previous Message Alvaro Herrera 2019-12-10 17:35:16 Re: BUG #16104: Invalid DSA Memory Alloc Request in Parallel Hash