]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stats: tracking servers may incorrectly report an inherited DRAIN status
authorWilly Tarreau <w@1wt.eu>
Wed, 21 May 2014 15:13:13 +0000 (17:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 21 May 2014 15:13:13 +0000 (17:13 +0200)
The DRAIN status is not inherited between tracked servers, so the stats
page must only use the reported server's status and not the tracked
server's status, otherwise it misleadingly indicates a DRAIN state when
a server tracks a draining server, while this is wrong.

src/dumpstats.c

index 5bfada7a9b924ad47c92bf80c466f73467c7f899..1d9531f1b21a154b00fb3e535c1cd4a6489c0f61 100644 (file)
@@ -3627,7 +3627,7 @@ static int stats_dump_proxy_to_buffer(struct stream_interface *si, struct proxy
                                else
                                        sv_state = 2; /* going down */
 
-                               if (server_is_draining(svs))
+                               if (server_is_draining(sv))
                                        sv_state += 4;
                                else if (svs->state & SRV_GOINGDOWN)
                                        sv_state += 2;