BUG/MINOR: checks: properly handle wrapping time in __health_adjust()
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Feb 2021 14:15:15 +0000 (15:15 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 22 Feb 2021 09:23:25 +0000 (10:23 +0100)
commit4d45917e6e57c29e9cc7f1a3cb05f6e4212ee842
tree17897631f003be1b1abb7fccea2e19f48eb97966
parent86eb8369d3c584631e6f4f93a2e2cfcba945bee6
BUG/MINOR: checks: properly handle wrapping time in __health_adjust()

There's an issue when a server state changes, we use an integer comparison
to decide whether or not to reschedule a test instead of using a wrapping
timer comparison. This will cause some health-checks not to be immediately
triggered half of the time, and some unneeded calls to task_queue() to be
performed in other cases.

This bug has always been there as it was introduced with the commit that
added the feature, 97f07b832 ("[MEDIUM] Decrease server health based on
http responses / events, version 3"). This may be backported everywhere.

(cherry picked from commit 64ba5ebadcd5d98e00989d08dfaa3c94c15196c9)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/check.c