I am using HAProxy socket communication to put my backend into maintenance mode before bringing the web server down for maintenance via this command:
echo "disable server cluster-01/app-01-4" | sudo socat stdio /tmp/haproxy.sock
The problem is that when I mark the backend available again via the socket enable command, HAProxy does not wait for any successful health checks before sending requests to the backend. So we end up losing some of the requests before HAProxy realizes the server is still down, and takes it back off line.
Is there a way to tell HAProxy to wait until the backend is healthy prior to enabling it? Or do I have to make my startup scripts smart enough to monitor the server itself prior to telling HaProxy to enable the backend again? This would obviously be less than ideal.
I'm currently doing this:
echo "enable server cluster-01/app-01-4" | sudo socat stdio /tmp/haproxy.sock
Is there something akin to this that I can use instead?
echo "enable server cluster-01/app-01-4 WAIT_FOR_SUCCESSFUL_HEALTH_CHECK" | sudo socat stdio /tmp/haproxy.sock
Edit: I am using HAProxy version 1.5x