]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-ana: increment internal_errors counter on response error
authorDragan Dosen <ddosen@haproxy.com>
Tue, 21 Sep 2021 11:02:09 +0000 (13:02 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 23 Sep 2021 14:25:47 +0000 (16:25 +0200)
A bug was introduced in the commit cff0f739e51 ("MINOR: counters: Review
conditions to increment counters from analysers"). The internal_errors
counter for the target server was incremented twice. The counter for the
session listener needs to be incremented instead.

This must be backported everywhere the commit cff0f739e51 is.

src/http_ana.c

index 7d9abdbbc87423db120ac5190efaa4036a1227e7..0e3d0600fb0b6c2b773da7bf9f84c5e0681f55b4 100644 (file)
@@ -2009,8 +2009,8 @@ int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, s
                s->flags |= SF_ERR_INTERNAL;
        _HA_ATOMIC_INC(&sess->fe->fe_counters.internal_errors);
        _HA_ATOMIC_INC(&s->be->be_counters.internal_errors);
-       if (objt_server(s->target))
-               _HA_ATOMIC_INC(&__objt_server(s->target)->counters.internal_errors);
+       if (sess->listener && sess->listener->counters)
+               _HA_ATOMIC_INC(&sess->listener->counters->internal_errors);
        if (objt_server(s->target))
                _HA_ATOMIC_INC(&__objt_server(s->target)->counters.internal_errors);
        goto return_prx_err;