]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: Do not set agent health to zero if server is disabled in config
authorSimon Horman <horms@verge.net.au>
Wed, 12 Nov 2014 06:55:53 +0000 (15:55 +0900)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 Jan 2015 15:47:41 +0000 (16:47 +0100)
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 <mark@loadbalancer.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
src/cfgparse.c
src/server.c

index 8a5dfe505f3c5aff52dcac7f48d5144166a521b7..c5f20a36a29e5e726a4ee30e571e915e2f045fe8 100644 (file)
@@ -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;
index 4f9fad859b9a2afc6485773dd1c1b2de909a2a61..b19ebbeca950944564bf80f40948d12190a8b525 100644 (file)
@@ -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")) {