Close listening socokets before forking

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: pgpool-hackers(at)lists(dot)postgresql(dot)org
Subject: Close listening socokets before forking
Date: 2026-03-02 01:00:28
Message-ID: 20260302.100028.1346768433787074248.ishii@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-hackers

Currently when pgpool main process forks sub processes (child process
- user session process, pcp_main process, health check process,
streaming replication check process and life check process), they
inherits pgpool and pcp listening sockets. However some of processes
do not need those sockets:

- child process - pcp sockets are unnecessary
- pcp main process - pgpool sockets are unnecessary
- health check, streaming replication check and life check process -
pgpool and pcp sockets are unnecessary

It could be potential problem when those process go down. Since they
may keep the listening sockets for a while, which prevents next pgpool
starting up from binding those ports.

Attached patch closes those unnecessary sockets after forking. For
this purpose new function close_listening_sockets() is introduced.

Best regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

Attachment Content-Type Size
close_socks.patch application/octet-stream 4.2 KB

Responses

Browse pgpool-hackers by date

  From Date Subject
Next Message Yishai Tamir 2026-03-04 18:39:27 [PATCH] Downgrade elog(LOG) to elog(DEBUG1) for pi->node_ids in get_pools()
Previous Message Nadav Shatz 2026-02-26 15:26:33 Re: Proposal: Recent mutated table tracking in memory