MEDIUM: checks: enable agent checks even if health checks are disabled
authorWilly Tarreau <w@1wt.eu>
Wed, 11 Dec 2013 20:26:24 +0000 (21:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 14 Dec 2013 15:02:20 +0000 (16:02 +0100)
The agent is able to retrieve some weight information from the server
and will eventually be able to force the server into maintenance mode.
It doesn't seem logical to have it depend on the health check being
configured, as for some servers it might very well make sense to only
fetch the weight from the server's load regardless of the health.

So let's stop disabling the agent checks when health checks are disabled.

src/checks.c

index 9b00062..9fdf060 100644 (file)
@@ -1507,9 +1507,7 @@ static struct task *process_chk(struct task *t)
                 * stopped, the server should not be checked or the check
                 * is disabled.
                 */
-               if (!(check->state & CHK_ST_ENABLED) ||
-                   !(s->check.state & CHK_ST_ENABLED) ||
-                   (s->check.state & CHK_ST_PAUSED) ||
+               if (((check->state & (CHK_ST_ENABLED | CHK_ST_PAUSED)) != CHK_ST_ENABLED) ||
                    s->proxy->state == PR_STSTOPPED)
                        goto reschedule;