Fix signal unblock leak in failover.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Thu, 3 Oct 2019 12:33:09 +0000 (21:33 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Thu, 3 Oct 2019 12:38:22 +0000 (21:38 +0900)
When failover event occurs, register_node_operation_request() gets
called to en-queue failover/failback requests. If the request queue is
full, this function returns false with unlocking semaphore. But it
forgot to unblock signal mask. This leads to block all signals
including SITERM, which makes pgpool fail to shutdown.

Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2019-October/003449.html

src/main/pgpool_main.c

index 23c47f24deae97fe51438c07111158e5cfedea3c..c90ec8c2de574f15c8a3873e2fb8b23e90587030 100644 (file)
@@ -644,6 +644,7 @@ bool register_node_operation_request(POOL_REQUEST_KIND kind, int* node_id_set, i
        if((Req_info->request_queue_tail - MAX_REQUEST_QUEUE_SIZE) == Req_info->request_queue_head)
        {
                pool_semaphore_unlock(REQUEST_INFO_SEM);
+               POOL_SETMASK(&oldmask);
                return false;
        }
        Req_info->request_queue_tail++;