[pgpool-committers: 4287] pgpool: Fix exit signal handlers to not call ereport.

Tatsuo Ishii ishii at postgresql.org
Fri Sep 22 11:02:06 JST 2017


Fix exit signal handlers to not call ereport.

There could be a race condition in the exit signal handlers. While
ereport is called in the handler, other interruption could call
ereport again. If ereport calls tz_convert which tries to acquire a
lock, it goes into a deadlock situation. In other word, tz_convert is
not reentrant and should not be used in signal handlers. So I removed
all ereport calls from exit signal handlers.

BTW pcp main calls ereport before the exception handler is
established. This could cause problem of course. So I fixed this
together. See [pgpool-hackers: 2545] for more details.

Branch
------
V3_5_STABLE

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

Modified Files
--------------
src/main/pgpool_main.c  | 29 ++---------------------------
src/pcp_con/pcp_child.c | 24 ++++--------------------
2 files changed, 6 insertions(+), 47 deletions(-)



More information about the pgpool-committers mailing list