]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-ana: Increment failed_resp counters on invalid response
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 Feb 2020 09:16:41 +0000 (10:16 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Feb 2020 14:13:03 +0000 (15:13 +0100)
In http_process_res_common() analyzer, when a invalid response is reported, the
failed_resp counters must be incremented.

No need to backport this patch, except if the commit b8a5371a ("MEDIUM:
http-ana: Properly handle internal processing errors") is backported too.

src/http_ana.c

index 2548a9ad56b20ecc694431132569b4916a26bdc9..7ff474e3d76c199ae54a0c4ddedbfe87cbb82d15 100644 (file)
@@ -2159,6 +2159,11 @@ int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, s
 
  return_bad_res:
        txn->status = 502;
+       _HA_ATOMIC_ADD(&s->be->be_counters.failed_resp, 1);
+       if (objt_server(s->target)) {
+               _HA_ATOMIC_ADD(&__objt_server(s->target)->counters.failed_resp, 1);
+               health_adjust(__objt_server(s->target), HANA_STATUS_HTTP_RSP);
+       }
        /* fall through */
 
  return_prx_err: