From: Willy Tarreau Date: Mon, 18 Mar 2019 10:02:57 +0000 (+0100) Subject: BUG/MINOR: http/counters: fix missing increment of fe->srv_aborts X-Git-Tag: v2.0-dev2~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d1fd6f5f64e4d05d4993f2d43c1ee8c79a16fec1;p=thirdparty%2Fhaproxy.git BUG/MINOR: http/counters: fix missing increment of fe->srv_aborts 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. --- diff --git a/src/proto_http.c b/src/proto_http.c index 4190313d59..4c9e609b35 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -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); diff --git a/src/proto_htx.c b/src/proto_htx.c index a65297dc08..f9e35e5c89 100644 --- a/src/proto_htx.c +++ b/src/proto_htx.c @@ -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);