From: Simon Horman Date: Wed, 12 Nov 2014 06:55:53 +0000 (+0900) Subject: BUG/MEDIUM: Do not set agent health to zero if server is disabled in config X-Git-Tag: v1.6-dev1~170 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a23cf0dfbdd117bce46bc3d75f2e0d7b3343958;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: Do not set agent health to zero if server is disabled in config disable starts a server in the disabled state, however setting the health of an agent implies that the agent is disabled as well as the server. This is a problem because the state of the agent is not restored if the state of the server is subsequently updated leading to an unexpected state. For example, if a server is started disabled and then the server state is set to ready then without this change show stat indicates that the server is "DOWN (agent)" when it is expected that the server would be UP if its (non-agent) health check passes. Reported-by: Mark Brooks Signed-off-by: Simon Horman --- diff --git a/src/cfgparse.c b/src/cfgparse.c index 8a5dfe505f..c5f20a36a2 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -7071,7 +7071,6 @@ out_uri_auth_compat: newsrv->admin |= SRV_ADMF_IMAINT; newsrv->state = SRV_ST_STOPPED; newsrv->check.health = 0; - newsrv->agent.health = 0; } newsrv->track = srv; diff --git a/src/server.c b/src/server.c index 4f9fad859b..b19ebbeca9 100644 --- a/src/server.c +++ b/src/server.c @@ -1224,7 +1224,6 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr newsrv->state = SRV_ST_STOPPED; newsrv->check.state |= CHK_ST_PAUSED; newsrv->check.health = 0; - newsrv->agent.health = 0; cur_arg += 1; } else if (!defsrv && !strcmp(args[cur_arg], "observe")) {