Conversation
lib/synapse/haproxy.rb
Outdated
There was a problem hiding this comment.
I don't think we want to ignore 0 weight backends because that seems like a reasonable use case? (I believe that nerve supplies nil if there is no weight).
What do you think?
|
Looks reasonable, can you check that this works with the state file (we should/will add tests of that soon)? Also this doesn't have code for doing updates over the socket, but we presumably want that. Is that going to come in a follow up patch? |
spec/lib/synapse/haproxy_spec.rb
Outdated
|
@jolynch ack - thanks for the feedback. I'll add tests around the state file, and I had totally forgotten the weight updates over the socket. I'd however prefer to do that as a separate patch to keep things relatively simple. Does that work for you? |
|
My only issue with doing the socket update in a subsequent change is that something else will have to trigger a HAProxy reload to pick up any change in weights (since this patch neither informs the haproxy module that it needs to reload nor changes the weights over the stats socket). At the very least I think it should inform haproxy to restart? |
|
#140 shows a technique for noticing things have changed via the state file. Perhaps we should just make the state file mandatory ... |
be ignored. This commit is based on: airbnb#131 but does the following things differently: 1. By default weights are ignored. This is to maintain current behavior for safety. 2. HAProxy will reconfigure if weights changes.
be ignored. This commit is based on: airbnb#131 but does the following things differently: 1. By default weights are ignored. This is to maintain current behavior for safety. 2. HAProxy will reconfigure if weights changes.
cc @vulpine
Rebased against airbnb/synapse master