pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Law <exclusion@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #16154: pg_ctl restart with a logfile fails sometimes (on Windows)
Date: Tue, 10 Dec 2019 13:24:10 -0500
Message-ID: <23006.1576002250@sss.pgh.pa.us> (raw)
In-Reply-To: <CAJ0YPFGG9J8TDZ9pBcSt7dNjW4Gj=cdg8+-kHrhJQP2q8=0U9Q@mail.gmail.com>
References: <16154-1ccf0b537b24d5e0@postgresql.org>
	<e5179494-715e-f8a3-266b-0cf52adac8f4@gmail.com>
	<CAA4eK1JwEciJePdqhYRezoWcr=JQvqyiEWxqgYMXSuZ40RQW3Q@mail.gmail.com>
	<CAJ0YPFFa6nLbHBYbiu5HgKZ5XYnOLsW4RaJgdjp8LA6x4p4kxA@mail.gmail.com>
	<29331.1575737694@sss.pgh.pa.us>
	<CAJ0YPFEH=y0=zbUx4_8PrCn2aAWPWEf2GpAyzcTTQLuBd8HHcg@mail.gmail.com>
	<3039.1575746766@sss.pgh.pa.us>
	<CAJ0YPFGG9J8TDZ9pBcSt7dNjW4Gj=cdg8+-kHrhJQP2q8=0U9Q@mail.gmail.com>

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





view thread (12+ messages)  latest in thread

Message-ID: <23006.1576002250@sss.pgh.pa.us>
Permalink:  ../23006.1576002250@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23006.1576002250@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, exclusion@gmail.com, amit.kapila16@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16154: pg_ctl restart with a logfile fails sometimes (on Windows)
  In-Reply-To: <23006.1576002250@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox