]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http/counters: fix missing increment of fe->srv_aborts
authorWilly Tarreau <w@1wt.eu>
Mon, 18 Mar 2019 10:02:57 +0000 (11:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 18 Mar 2019 14:50:23 +0000 (15:50 +0100)
When a server aborts a transfer, we used to increment the backend's
counter but not the frontend's during the forwarding phase. This fixes
it. It might be backported to all supported versions (possibly removing
the htx part) though it is of very low importance.

src/proto_http.c
src/proto_htx.c

index 4190313d5927f9e8a5acb329df7209b03cf42cbf..4c9e609b35217c834ee9507d477a6055a7ed2697 100644 (file)
@@ -5295,6 +5295,7 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit
                if (!ci_data(res)) {
                        if (!(s->flags & SF_ERR_MASK))
                                s->flags |= SF_ERR_SRVCL;
+                       _HA_ATOMIC_ADD(&sess->fe->fe_counters.srv_aborts, 1);
                        _HA_ATOMIC_ADD(&s->be->be_counters.srv_aborts, 1);
                        if (objt_server(s->target))
                                _HA_ATOMIC_ADD(&objt_server(s->target)->counters.srv_aborts, 1);
index a65297dc0818126b8d76ce7a38e279c3300e874e..f9e35e5c890ae134364c2b8bdca3764379d4e0cf 100644 (file)
@@ -2261,6 +2261,7 @@ int htx_response_forward_body(struct stream *s, struct channel *res, int an_bit)
                if (htx_is_empty(htx)) {
                        if (!(s->flags & SF_ERR_MASK))
                                s->flags |= SF_ERR_SRVCL;
+                       _HA_ATOMIC_ADD(&sess->fe->fe_counters.srv_aborts, 1);
                        _HA_ATOMIC_ADD(&s->be->be_counters.srv_aborts, 1);
                        if (objt_server(s->target))
                                _HA_ATOMIC_ADD(&objt_server(s->target)->counters.srv_aborts, 1);