postgresql/src/backend/port
Tom Lane b484ddf4d2 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
2021-09-30 14:16:08 -04:00
..
aix Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
hpux Redefine Datum as uintptr_t, instead of unsigned long. 2009-12-31 19:41:37 +00:00
tas Update copyright for 2021 2021-01-02 13:06:25 -05:00
win32 Treat ETIMEDOUT as indicating a non-recoverable connection failure. 2021-09-30 14:16:08 -04:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
atomics.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
Makefile Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
posix_sema.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
sysv_sema.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
sysv_shmem.c Introduce GUC shared_memory_size_in_huge_pages 2021-09-21 10:31:58 +09:00
win32_sema.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
win32_shmem.c Introduce GUC shared_memory_size_in_huge_pages 2021-09-21 10:31:58 +09:00