mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-12 06:24:56 +00:00
c7b391aed2
To perform servers resolution, the resolver's lock is first acquired then the server's lock when necessary. However, when the fqdn is set via the CLI, the opposite is performed. So, it is possible to experience an ABBA deadlock. To fix this bug, the server's lock is acquired and released for each subcommand of "set server" with an exception when the fqdn is set. The resolver's lock is first acquired. Of course, this means we must be sure to have a resolver to lock. This patch must be backported as far as 1.8.
34 lines
743 B
Plaintext
34 lines
743 B
Plaintext
varnishtest "Set server FQDN via CLI crash"
|
|
|
|
feature ignore_unknown_macro
|
|
|
|
# for "set server <srv> fqdn"
|
|
#REQUIRE_VERSION=1.8
|
|
#REGTEST_TYPE=bug
|
|
|
|
# Do nothing. Is there only to create s1_* macros
|
|
server s1 {
|
|
} -start
|
|
|
|
haproxy h1 -conf {
|
|
defaults
|
|
mode http
|
|
timeout connect 1s
|
|
timeout client 1s
|
|
timeout server 1s
|
|
|
|
frontend myfrontend
|
|
bind "fd@${my_fe}"
|
|
default_backend test
|
|
|
|
backend test
|
|
server www1 ${s1_addr}:${s1_port}
|
|
} -start
|
|
|
|
haproxy h1 -cli {
|
|
send "set server test/www1 fqdn foo.fqdn"
|
|
expect ~ "set server <b>/<s> fqdn failed because no resolution is configured."
|
|
send "show servers state test"
|
|
expect ~ "test 1 www1 ${s1_addr} .* - ${s1_port}"
|
|
} -wait
|