Old process hanging around after reloads #172
Description
I've been doing some testing around reliability of reconfiguration when services change. From reading the docs, when haproxy reloads, a new process is created with the new config and attaches to the socker. When all TCP connections to the old process have died, the process also dies.
I've seen situations where the old haproxy process hangs around longer than expected (at least several minutes), with browsers still being connected to it. This returns a 500 page because after Docker redeploys the service, the original backend containers no longer exist.
This is presumably because http keepalives are keeping the tcp connection open?
I can see that we could give existing connections a period to hopefully finish, but at some point anything hanging will have broken, and so needs to be killed.
Basically, how about adding a configurable timeout to the reload that kills the old process off eventually?
I'm not really a python developer, but I've have a dig around in the code, and it doesn't look like it would be too tricky - the main file appears to be https://github.com/docker/dockercloud-haproxy/blob/e52edde30e03403834f909ca0db7368af8cecffd/haproxy/helper/update_helper.py
I'll have a go at implementing this and send a PR if it sounds like a sensible idea?