pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: On Windows, wait a little to see if ERROR_ACCESS_DENIED goes awa
Date: Mon, 16 Dec 2019 20:11:16 +0000
Message-ID: <E1igwi4-0007yb-Rs@gemulon.postgresql.org> (raw)

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

Attempting to open a file fails with ERROR_ACCESS_DENIED if the file
is flagged for deletion but not yet actually gone (another in a long
list of reasons why Windows is broken, if you ask me).  This seems
likely to explain a lot of irreproducible failures we see in the
buildfarm.  This state generally persists for only a millisecond or so,
so just wait a bit and retry.  If it's a real permissions problem,
we'll eventually give up and report it as such.  If it's the pending
deletion case, we'll see file-not-found and report that after the
deletion completes, and the caller will treat that in an appropriate
way.

In passing, rejigger the existing retry logic for some other error
cases so that we don't uselessly wait an extra time when we're
not going to retry anymore.

Alexander Lakhin (with cosmetic tweaks by me).  Back-patch to all
supported branches, since this seems like a pretty safe change and
the problem is definitely real.

Discussion: https://postgr.es/m/16161-7a985d2f1bbe8f71@postgresql.org

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/cfb2a4cce37bdb279a9360913b3ef29be3079f98

Modified Files
--------------
src/port/open.c | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)



view thread (7+ messages)

Message-ID: <E1igwi4-0007yb-Rs@gemulon.postgresql.org>
Permalink:  ../E1igwi4-0007yb-Rs@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1igwi4-0007yb-Rs@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: On Windows, wait a little to see if ERROR_ACCESS_DENIED goes awa
  In-Reply-To: <E1igwi4-0007yb-Rs@gemulon.postgresql.org>
  References: <E1igwi4-0007yb-Rs@gemulon.postgresql.org>

* 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