From: Christopher Faulet Date: Tue, 11 Apr 2023 05:41:30 +0000 (+0200) Subject: BUG/MEDIUM: stats: Eat output data when waiting for appctx shutdown X-Git-Tag: v2.8-dev8~196 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9837bd86dc8ca0de785e9c909f8c551a283e6bd1;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stats: Eat output data when waiting for appctx shutdown When the stats applet is executed while a shut is pending, the remaining output data must always be consumed. Otherwise, this can prevent the stream to exit, leading to a spinning loop on the applet. It is 2.8-specific. No backport needed. --- diff --git a/src/stats.c b/src/stats.c index 18a5f01799..0fa2df3620 100644 --- a/src/stats.c +++ b/src/stats.c @@ -4459,8 +4459,10 @@ static void http_stats_io_handler(struct appctx *appctx) res_htx = htx_from_buf(&res->buf); - if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW)))) + if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW)))) { + appctx->st0 = STAT_HTTP_END; goto out; + } /* Check if the input buffer is available. */ if (!b_size(&res->buf)) {