From: Tom Lane <tgl@sss.pgh.pa.us>
To: r.zharkov@postgrespro.ru
Cc: Badrul Chowdhury <bachow@microsoft.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Intermittent pg_ctl failures on Windows
Date: Wed, 17 Jul 2019 09:51:48 -0400
Message-ID: <26631.1563371508@sss.pgh.pa.us> (raw)
In-Reply-To: <0057a0ce5a8893e4713a9a9d7e352162@postgrespro.ru>
References: <16922.1520722108@sss.pgh.pa.us>
<DM5PR2101MB0984D3DB39BCCCF189ECD15ED1D30@DM5PR2101MB0984.namprd21.prod.outlook.com>
<0057a0ce5a8893e4713a9a9d7e352162@postgrespro.ru>
r.zharkov@postgrespro.ru writes:
> pg_ctl now opens the postmaster.pid file using pgwin32_open() function
> to correctly handle share locks.
HEAD already does that, no? See f02259fe9.
> On Windows systems we cannot handle ERROR_DELETE_PENDING because
> GetLastError() returns ERROR_ACCESS_DENIED instead.
> So we rename the lock files before delete them.
This seems improbably broken/stupid. Also, I've not seen any buildfarm
failures that would match this; it's always pg_ctl complaining not the
postmaster.
> To avoid the second error we added the wait for cmd.exe finish in the
> do_stop() and do_restart() functions.
Hmmm ... there seems the germ of a good idea here, but can't we do
it with less (and less ugly) code?
Alternatively, perhaps we could fix things so that the parent cmd.exe
shell isn't involved in logfile access? That'd require teaching the
postmaster to open/redirect its stdout/stderr, which is kind of
annoying, but it might beat hacking things as you have done here.
regards, tom lane
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, r.zharkov@postgrespro.ru, bachow@microsoft.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Intermittent pg_ctl failures on Windows
In-Reply-To: <26631.1563371508@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