]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: checks: successful check completion must not re-enable MAINT servers
authorWilly Tarreau <w@1wt.eu>
Mon, 23 Dec 2013 13:04:17 +0000 (14:04 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 23 Dec 2013 13:04:17 +0000 (14:04 +0100)
If a server is switched to maintenance mode while a check is in progress,
the successful completion of the check must not switch it back up. This
is still a consequence of using the same function set_server_up() for
every state change. Bug reported by Igor at owind.

This fix should be backported to 1.4 which is affected as well.

src/checks.c

index 115cc855841b329bcb16ead99466a4699bf51e95..bdb8f07ad74dcd6cbeb233e386837eba68a2604b 100644 (file)
@@ -1682,7 +1682,8 @@ static struct task *process_chk(struct task *t)
                                        set_server_disabled(check);
                        }
 
-                       if (check->health < check->rise + check->fall - 1) {
+                       if (!(s->state & SRV_MAINTAIN) &&
+                           check->health < check->rise + check->fall - 1) {
                                check->health++; /* was bad, stays for a while */
                                set_server_up(check);
                        }