We are reloading HAProxy by the following command in our program (doing exec in Go):
haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -x /var/run/haproxy.sock -sf <pidlist>
So inside the container, we inspected the reload. It is showing that there are 2 haproxy process running - the old process takes some time to close. Although there aren’t supposed to be any active sessions that can hold it.
726 root 0:00 haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -x /var/run/haproxy.sock -sf 723
750 root 0:00 haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -x /var/run/haproxy.sock -sf 745
A crucial details here - this is ps aux output after 2 reload - one immediately after another (inside kubernetes cluster - scaling down/up). So 726 is original process, 745 is pid after first reload and 750 is pid after second reload. Second process isn’t showed here, because after second reload 745 closes almost immediately, but the original process 726 is still ongoing. (closes after about 20s).
Does it usually take so long (around 20 s) or are we using the parameters wrong?
Also, is it possible in any case that old haproxy process never closes using this command?