I'm working on making my application capable of handling service restarts on the back end with zero loss or interruption.  It runs on two servers behind haproxy.

At application shutdown, I'm setting a flag that makes the healthcheck fail, and then keeping the application running for thirty seconds in order to finish up all requests that the server has already received.

It seems that when haproxy's health check fails while a request is underway, the machine making the request will be sent a 502 response instead of the good response that the server WILL make. This is probably a good thing for haproxy to do in general, but in this case, I know that my application's shutdown hook *WILL* allow enough time for the request to finish before it forcibly halts the application.

Is there a config option I can enable to allow in-flight responses to be returned after check failure?  Would I need to upgrade beyond 1.5 to get that working?  If the server doesn't send a good response within the timeout limit, then I'm perfectly OK with haproxy returning an error.

Thanks,
Shawn


Reply via email to