pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Check for STATUS_DELETE_PENDING on Windows.
Date: Thu, 07 Nov 2024 23:19:39 +0000
Message-ID: <E1t9Bms-000hQb-Q1@gemulon.postgresql.org> (raw )
Check for STATUS_DELETE_PENDING on Windows.
1. Update our open() wrapper to check for NT's STATUS_DELETE_PENDING
and translate it to Unix-like errors. This is done with
RtlGetLastNtStatus(), which is dynamically loaded from ntdll. A new
file win32ntdll.c centralizes lookup of NT functions, in case we decide
to add more in the future.
2. Remove non-working code that was trying to do something similar for
stat(), and just reuse the open() wrapper code. As a side effect,
stat() also gains resilience against "sharing violation" errors.
3. Since stat() is used very early in process startup, remove the
requirement that the Win32 signal event has been created before
pgwin32_open_handle() is reached. Instead, teach pg_usleep() to fall
back to a non-interruptible sleep if reached before the signal event is
available.
This could be back-patched, but for now it's in master only. The
problem has apparently been with us for a long time and generated only a
few complaints. Proposed patches trigger it more often, which led to
this investigation and fix.
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Alexander Lakhin <exclusion@gmail.com>
Reviewed-by: Juan José SantamarÃa Flecha <juanjo.santamaria@gmail.com>
Discussion: https://postgr.es/m/CA%2BhUKGJz_pZTF9mckn6XgSv69%2BjGwdgLkxZ6b3NWGLBCVjqUZA%40mail.gmail.com
(cherry picked from commit e2f0f8ed251d02c1eda79e1ca3cb3db2681e7a86)
Author: Thomas Munro <tmunro@postgresql.org>
Author: Alexandra Wang <alexandra.wang.oss@gmail.com>
Branch
------
REL_13_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/56b39cce778f93cd95a01df0da083e937424662d
Author: Thomas Munro <tmunro@postgresql.org>
Modified Files
--------------
configure | 6 +++
configure.in | 1 +
src/backend/port/win32/signal.c | 12 ++++-
src/include/port.h | 1 +
src/include/port/win32ntdll.h | 27 +++++++++++
src/port/open.c | 104 +++++++++++++++++++++-------------------
src/port/win32ntdll.c | 69 ++++++++++++++++++++++++++
src/port/win32stat.c | 78 +++---------------------------
src/tools/msvc/Mkvcbuild.pm | 3 +-
9 files changed, 179 insertions(+), 122 deletions(-)
view thread (9+ messages)
Message-ID: <E1t9Bms-000hQb-Q1@gemulon.postgresql.org>
Permalink: ../E1t9Bms-000hQb-Q1@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1t9Bms-000hQb-Q1@gemulon.postgresql.org
copy link · copy postgr.es
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-committers@postgresql.org
Cc: andrew@dunslane.net, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Check for STATUS_DELETE_PENDING on Windows.
In-Reply-To: <E1t9Bms-000hQb-Q1@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