<div dir="ltr"><div>Currently, listen socket is left open while graceful (smart) shutdown is<br></div><div>ongoing. In practice, shutdown can take long due to long-running queries,</div><div>lock waits, etc. Since pgpool process during the period still listens on</div>
<div>the port, further connection requests can be made and queued, only to fail</div><div>when the shutdown process is complete.</div><div><br></div><div>I think it would be better to close listen socket immediately when a</div>
<div>shutdown request is received so that the further connection requests are</div><div>refused right away. This is especially important when multiple pgpool</div><div>servers are backed by a load balancer which has to realize the status of</div>
<div>the listening ports and act accordingly.</div><div><br></div><div>What do you think? I&#39;m attaching a patch which does that, that we&#39;re</div><div>planning to apply on our production servers. Test shows that it works as</div>
<div>expected. Will there be any side effects?</div><div><br></div><div>Thanks,</div><div>Junegunn Choi.</div></div>