Fix pgpool crash when pgpool child process exits.
authorTatsuo Ishii <ishii@postgresql.org>
Wed, 18 Sep 2024 02:25:10 +0000 (11:25 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Wed, 18 Sep 2024 02:34:08 +0000 (11:34 +0900)
commit04142b465f22742bbd3ddd49cf63179919b704c7
treea875d96a22d7afdbfb8e659ba0495db2cca8c31e
parent12e1b7827929eb30dcf275381c098ab266c78c3b
Fix pgpool crash when pgpool child process exits.

When a pgpool child process exits, close_all_backend_connections() is
called, which is responsible for closing all connections to backend in
the connection pool. It used mistakenly MAIN_CONNECTION macro, which
is fine for current active connections but is not good for pooled
connections because a main node could be different at the time when
the connection pool was created. Fix is using in_use_backend()
instead.

Reported-by: Emond Papegaaij
Backpatch-through: v4.2
src/protocol/pool_connection_pool.c