diff options
author | Thomas Munro <tmunro@postgresql.org> | 2022-02-14 16:29:44 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2022-02-14 16:52:23 +1300 |
commit | cba5b994c990bba8df9b8bb75f25ca40aef6b68b (patch) | |
tree | 8189f1b0691ee24a9289afceb3dbf2ea1a4bcd6d /src/backend/utils/misc/guc.c | |
parent | 50e570a59e7f86bb41f029a66b781fc79b8d50f1 (diff) | |
download | postgresql-cba5b994c990bba8df9b8bb75f25ca40aef6b68b.tar.gz postgresql-cba5b994c990bba8df9b8bb75f25ca40aef6b68b.zip |
Use WL_SOCKET_CLOSED for client_connection_check_interval.
Previously we used poll() directly to check for a POLLRDHUP event.
Instead, use the WaitEventSet API to poll the socket for
WL_SOCKET_CLOSED, which knows how to detect this condition on many more
operating systems.
Reviewed-by: Zhihong Yu <zyu@yugabyte.com>
Reviewed-by: Maksim Milyutin <milyutinma@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/77def86b27e41f0efcba411460e929ae%40postgrespro.ru
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r-- | src/backend/utils/misc/guc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index f505413a7f9..e2fe219aa82 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -12192,14 +12192,11 @@ check_huge_page_size(int *newval, void **extra, GucSource source) static bool check_client_connection_check_interval(int *newval, void **extra, GucSource source) { -#ifndef POLLRDHUP - /* Linux only, for now. See pq_check_connection(). */ - if (*newval != 0) + if (!WaitEventSetCanReportClosed() && *newval != 0) { - GUC_check_errdetail("client_connection_check_interval must be set to 0 on platforms that lack POLLRDHUP."); + GUC_check_errdetail("client_connection_check_interval must be set to 0 on this platform"); return false; } -#endif return true; } |