-
Notifications
You must be signed in to change notification settings - Fork 300
use haproxy-systemd-wrapper, remove iptables #386
Conversation
Can one of the admins verify this patch? |
If |
HAPROXY_RELOAD_SIGTERM_DELAY is not the point here. The question is about switching from the whole bash script to haproxy-systemd-wrapper |
My only real concern with this PR is removing the iptables stuff. As much as I dislike the complexity, the "why do I occasionally see errors when reloading haproxy?" issue comes up more often than I'd like. AFAIK there are only 2 ways to work around this (excluding options such as putting another proxy in front), and this is the least complex of the 2 options. |
Could we just trap the SIGHUP and forward it to the wrapper instead? Then we can keep the iptables stuff. |
Actually I've realized the problem with doing that is that you wouldn't know when the reload has completed, without doing some kind of PID watching madness (which we already do inside |
haproxy use a file descriptor for this http://git.haproxy.org/?p=haproxy-1.7.git;a=commit;h=b957109727f7fed556c049d40bacf45f0df211db Delaying TCP syn should not be required, SO_REUSEPORT allows several programs to bind the same port. The old process can still receive incoming connections while draining, that's why a SIGTTOU signal is sent to it, to stop accepting new ones. In this case, we may have connections accepted by the kernel, but rejected by the old haproxy, I guess these are the 0.25% dropped connections. Ways to workaround:
With the exception of putting another proxy in front, AFAIK all of these are requiring running privileged, which is not always possible and unsafe. IMO, having tcp proxies which never reloads ( only use maps updated from the cli or DNS SRV, planned for haproxy 1.8 ) in front may be the best way to prevent all connection drops types and distribute traffic accross all "http" haproxy instances. This seems not possible to be part of MLB until it evolves to a mesos framework, but this is out of this PR's scope. |
Interesting. We do something similar to However, it looks like maybe we should just emulate the bahaviour in |
See #390 as an alternative to this. |
seems ok, thanks |
I propose to switch from the current custom haproxy reload script to haproxy-systemd-wrapper.
My motivations for this change are
HAPROXY_RELOAD_SIGTERM_DELAY
hack does not work ( haproxy never starts ), and even after fixing it, old process with outdated configuration can live for minutes.