BUG/MINOR: server: do not enable DNS resolution on disabled proxies
authorWilly Tarreau <w@1wt.eu>
Fri, 10 Jun 2022 09:11:44 +0000 (11:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Jun 2022 09:17:27 +0000 (11:17 +0200)
commit9b46fb4cca9ab673be8d1cdce6876a4abaa7918e
tree51f3c5d349b3ed490525d945627211ad0ab9e4c7
parent5a0e7ca5d058f71b72ff296cd51f15eaddb3ad60
BUG/MINOR: server: do not enable DNS resolution on disabled proxies

Leonhard Wimmer reported an interesting bug in github issue #1742.
Servers in disabled proxies that are configured for resolution are still
subscribed to DNS resolutions, but the LB algos are not initialized at
all since the proxy is disabled, so when the server state changes,
attempts to update its status cause a crash when the server's weight
is recalculated via a divide by the proxy's total weight which is zero.

This should be backported to all versions. Beware that before 2.5 or
so, there's no PR_FL_DISABLED flag, instead px->disabled should be
used (2.3-2.4) or PR_STSTOPPED for older versions.

Thanks to Leonhard for his report and quick test!
src/resolvers.c