]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: checks: a server passed in maint state was not forced down.
authorEmeric Brun <ebrun@haproxy.com>
Thu, 21 Dec 2017 13:42:26 +0000 (14:42 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 21 Dec 2017 14:23:55 +0000 (15:23 +0100)
Setting a server in maint mode, the required next_state was not set
before calling the 'lb_down' function and so the system state was never
commited.

This patch should be backported in 1.8

src/server.c

index 23e4cc98e0853706e826455c969ab400494c3413..a37e91968c0bca5516afcd145adee87c4f502e1f 100644 (file)
@@ -4630,10 +4630,11 @@ void srv_update_status(struct server *s)
                else {  /* server was still running */
                        check->health = 0; /* failure */
                        s->last_change = now.tv_sec;
+
+                       s->next_state = SRV_ST_STOPPED;
                        if (s->proxy->lbprm.set_server_status_down)
                                s->proxy->lbprm.set_server_status_down(s);
 
-                       s->next_state = SRV_ST_STOPPED;
                        if (s->onmarkeddown & HANA_ONMARKEDDOWN_SHUTDOWNSESSIONS)
                                srv_shutdown_streams(s, SF_ERR_DOWN);