[pgpool-hackers: 474] To close listen socket when smart shutdown request is made

Junegunn Choi junegunn.c at gmail.com
Fri Mar 28 14:11:49 JST 2014

Currently, listen socket is left open while graceful (smart) shutdown is
ongoing. In practice, shutdown can take long due to long-running queries,
lock waits, etc. Since pgpool process during the period still listens on
the port, further connection requests can be made and queued, only to fail
when the shutdown process is complete.

I think it would be better to close listen socket immediately when a
shutdown request is received so that the further connection requests are
refused right away. This is especially important when multiple pgpool
servers are backed by a load balancer which has to realize the status of
the listening ports and act accordingly.

What do you think? I'm attaching a patch which does that, that we're
planning to apply on our production servers. Test shows that it works as
expected. Will there be any side effects?

Junegunn Choi.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20140328/9e8f23f9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: close-listen-socket.patch
Type: application/octet-stream
Size: 1160 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20140328/9e8f23f9/attachment.obj>

More information about the pgpool-hackers mailing list