From: Simon Horman Date: Wed, 12 Nov 2014 06:55:54 +0000 (+0900) Subject: MEDIUM/BUG: Only explicitly report "DOWN (agent)" if the agent health is zero X-Git-Tag: v1.6-dev1~169 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0766e441dd32b39ab884f5882e35e082a1da7a7e;p=thirdparty%2Fhaproxy.git MEDIUM/BUG: Only explicitly report "DOWN (agent)" if the agent health is zero Make check check used to report explicitly report "DOWN (agent)" slightly more restrictive such that it only triggers if the agent health is zero. This avoids the following problem. 1. Backend is started disabled, agent check is is enabled 2. Backend is stabled using set server vip/rip state ready 3. Health is marked as down using set server vip/rip health down At this point the http stats page will report "DOWN (agent)" but the backend being down has nothing to do with the agent check This problem appears to have been introduced by cf2924bc2537bb08c ("MEDIUM: stats: report down caused by agent prior to reporting up"). Note that "DOWN (agent)" may also be reported by a more generic conditional which immediately follows the code changed by this patch. Reported-by: Mark Brooks Signed-off-by: Simon Horman --- diff --git a/src/dumpstats.c b/src/dumpstats.c index a608b47f94..a88e8acccb 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -3106,7 +3106,7 @@ static int stats_dump_sv_stats(struct stream_interface *si, struct proxy *px, in chunk_appendf(&trash, "%s ", human_time(now.tv_sec - sv->last_change, 1)); chunk_appendf(&trash, "MAINT"); } - else if ((ref->agent.state & CHK_ST_ENABLED) && (ref->state == SRV_ST_STOPPED)) { + else if ((ref->agent.state & CHK_ST_ENABLED) && !(sv->agent.health) && (ref->state == SRV_ST_STOPPED)) { chunk_appendf(&trash, "%s ", human_time(now.tv_sec - ref->last_change, 1)); /* DOWN (agent) */ chunk_appendf(&trash, srv_hlt_st[1], "GCC: your -Werror=format-security is bogus, annoying, and hides real bugs, I don't thank you, really!");