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

Tatsuo Ishii ishii at sraoss.co.jp
Tue Sep 1 12:46:19 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_5_STABLE

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

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