pgsql: Treat ETIMEDOUT as indicating a non-recoverable connection failu - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Treat ETIMEDOUT as indicating a non-recoverable connection failu
Date
Msg-id E1mW0bS-0007nR-Fw@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Treat ETIMEDOUT as indicating a non-recoverable connection failure.

Add ETIMEDOUT to ALL_CONNECTION_FAILURE_ERRNOS' list of "errnos that
identify hard failure of a previously-established network connection".
While one could imagine that this is sometimes recoverable, the same
could be said of other entries such as ENETDOWN.

In support of this, handle ETIMEDOUT on par with other socket errors
in relevant infrastructure, such as TranslateSocketError().
(I made a couple of cosmetic adjustments in TranslateSocketError(),
too.)  The code now assumes that ETIMEDOUT is defined everywhere,
which it should be given that POSIX has required it since SUSv2.

Perhaps this should be back-patched, but I'm hesitant to do so given
the lack of previous complaints, and the hazard that there's a small
ABI break on Windows from redefining the symbol.  Even if we decide
to do that, it'd be prudent to let this bake awhile in HEAD first.

Jelte Fennema

Discussion: https://postgr.es/m/AM5PR83MB01782BFF2978505F6D6C559AF7AA9@AM5PR83MB0178.EURPRD83.prod.outlook.com

Branch
------
master

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

Modified Files
--------------
src/backend/port/win32/socket.c | 11 ++++++++---
src/include/port.h              |  3 ++-
src/include/port/win32_port.h   |  2 ++
src/port/strerror.c             |  2 --
4 files changed, 12 insertions(+), 6 deletions(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pgsql: Fix WAL replay in presence of an incomplete record
Next
From: Tom Lane
Date:
Subject: pgsql: Remove gratuitous environment dependency in 002_types.pl test.