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 <m...@loadbalancer.org>
Signed-off-by: Simon Horman <ho...@verge.net.au>
---
 src/cfgparse.c | 1 -
 src/server.c   | 1 -
 2 files changed, 2 deletions(-)

diff --git a/src/cfgparse.c b/src/cfgparse.c
index 09a0fd3..820fbf4 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -6982,7 +6982,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 fdb63cc..ea6e3aa 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1223,7 +1223,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")) {
-- 
2.1.1


Reply via email to