mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-01 11:01:46 +00:00
004e045f31
A crash was reported by Igor at owind when changing a server's weight on the CLI. Lukas Tribus could reproduce a related bug where setting a server's weight would result in the new weight being multiplied by the initial one. The two bugs are the same. The incorrect weight calculation results in the total farm weight being larger than what was initially allocated, causing the map index to be out of bounds on some hashes. It's easy to reproduce using "balance url_param" with a variable param, or with "balance static-rr". It appears that the calculation is made at many places and is not always right and not always wrong the same way. Thus, this patch introduces a new function "server_recalc_eweight()" which is dedicated to this task of computing ->eweight from many other elements including uweight and current time (for slowstart), and all users now switch to use this function. The patch is a bit large but the code was not trivially fixable in a way that could guarantee this situation would not occur anymore. The fix is much more readable and has been verified to work with all algorithms, with both consistent and map-based hashes, and even with static-rr. Slowstart was tested as well, just like enable/disable server. The same bug is very likely present in 1.4 as well, so the patch will probably need to be backported eventhough it will not apply as-is. Thanks to Lukas and Igor for the information they provided to reproduce it. |
||
---|---|---|
.. | ||
acl.h | ||
arg.h | ||
auth.h | ||
backend.h | ||
channel.h | ||
checks.h | ||
compression.h | ||
connection.h | ||
cttproxy.h | ||
dumpstats.h | ||
fd.h | ||
freq_ctr.h | ||
frontend.h | ||
hdr_idx.h | ||
lb_chash.h | ||
lb_fas.h | ||
lb_fwlc.h | ||
lb_fwrr.h | ||
lb_map.h | ||
listener.h | ||
log.h | ||
obj_type.h | ||
payload.h | ||
peers.h | ||
pipe.h | ||
port_range.h | ||
proto_http.h | ||
proto_tcp.h | ||
proto_uxst.h | ||
protocol.h | ||
proxy.h | ||
queue.h | ||
raw_sock.h | ||
sample.h | ||
server.h | ||
session.h | ||
shctx.h | ||
signal.h | ||
ssl_sock.h | ||
stick_table.h | ||
stream_interface.h | ||
task.h | ||
template.h |