[pgpool-committers: 7070] pgpool: Fix connection_life_time not working when serialize_accept is e

Tatsuo Ishii ishii at sraoss.co.jp
Tue Sep 1 12:46:29 JST 2020


Fix connection_life_time not working when serialize_accept is enabled.

If serialize_accept is enabled, pgpool child process tries to acquire
semaphore locking so that there's only one process which can issue
accept(2). Unfortunately if connection_life_time is enabled, an alarm
is set right before the semaphore locking. So when the alarm fires,
nothing happened because the process was in acquiring semaphore lock
loop by using pool_semaphore_lock().

To fix this new pool_semaphore_lock_allow_interrupt() is introduced,
which immediately returns if interrupted by a signal. The caller:
wait_for_new_connections() checks whether connection_life_time alarm
is fired. If so, call backend_timer() to close expired backend
connection cache.

Discussion: https://www.pgpool.net/pipermail/pgpool-general/2020-August/007233.html

Branch
------
V3_7_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=89ce1e5976b83e9d486b89bce90febf401a1bedb

Modified Files
--------------
src/include/pool.h                  |  1 +
src/protocol/child.c                | 45 ++++++++++++++++++++++++++++++++++++-
src/protocol/pool_connection_pool.c |  2 +-
src/utils/pool_sema.c               | 42 ++++++++++++++++++++++++++++++++++
4 files changed, 88 insertions(+), 2 deletions(-)



More information about the pgpool-committers mailing list