-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition when HAproxy reloaded constantly #97
Comments
Good point, I ran into this issue just yesterday. Symptoms were getting back the number of rules in the status() call like this: haproxy_a: 6, haproxy_b: 0. 6 is twice the number of the actual rules. Maybe a better check would be >= num_rules instead of equality? |
I have analyzed that. Idea is to create 3 chains: HAPROXY , HAPROXY_A, HAPROXY_B configuration - done once :
1st assign:
So now, we can replace 1st rule (it is always 1st rule since it is our sandbox)
Now I have to check if replace will NOT drop connections |
Local tests looks ok
|
Iptables has its own mutex when it replace rules I will test it on Monday in production load |
looks good in prod |
There is a race condition with
haproxy_reload.sh
. consul-template trigger it always when config change.It could happen that it is triggered when previous did not finish. And next haproxy_reload.sh ends with
unknown
state.To Do:
-wait
remove()
function to remove all appearance of previous config, even if this should not exists.start using OWN chains per HAproxy instance - so iptables rules will not be removed but the chain.
ensure that ONLY one chain is active
unknown
state, than exit and do nothing.The text was updated successfully, but these errors were encountered: