Re: BUG #16161: pg_ctl stop fails sometimes (on Windows)

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, pgsql-bugs@lists.postgresql.org
Date: 2019-12-21T22:41:52Z
Lists: pgsql-bugs
Alexander Lakhin <exclusion@gmail.com> writes:
> 19.12.2019 18:44, Tom Lane wrote:
>> Entirely-untested patch along this line attached.

> I have tested it with my demo restart test and it works. Yes, stat() is
> resulted in the CreateFile() call too, so it should fail the same way.

Since this patch seems to fix the problem, I went ahead and pushed it.
We can still consider whether it can be improved, but I was getting
antsy about leaving the buildfarm broken.

			regards, tom lane



Commits

  1. In pgwin32_open, loop after ERROR_ACCESS_DENIED only if we can't stat.

  2. On Windows, wait a little to see if ERROR_ACCESS_DENIED goes away.