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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Treat ETIMEDOUT as indicating a non-recoverable connection failu
Дата
Msg-id E1mW0bS-0007nR-Fw@gemulon.postgresql.org
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: pgsql: Fix WAL replay in presence of an incomplete record
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Remove gratuitous environment dependency in 002_types.pl test.