From: Christopher Faulet Date: Fri, 21 Nov 2025 08:47:01 +0000 (+0100) Subject: BUG/MEDIUM: cli: State the cli have no more data to deliver if it yields X-Git-Tag: v3.3-dev14~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0629ce8f4bb180e6e056276af17d8609ee65f3b5;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: cli: State the cli have no more data to deliver if it yields A regression was introduced in the commit 2d7e3ddd4 ("BUG/MEDIUM: cli: do not return ACKs one char at a time"). When the CLI is processing a command line, we no longer send response immediately. It is especially useful for clients sending a bunch of commands with very short response. However, in that state, the CLI applet must state it has no more data to deliver. Otherwise it will be woken up again and again because data are found in its output buffer with no blocking conditions. In worst cases, if the command rate is really high, this can trigger the watchdog. This patch must be backported where the patch above is, so probably as far as 3.0. --- diff --git a/src/cli.c b/src/cli.c index fbf8f1d9d..cbcecff43 100644 --- a/src/cli.c +++ b/src/cli.c @@ -3910,8 +3910,10 @@ error: size_t cli_raw_rcv_buf(struct appctx *appctx, struct buffer *buf, size_t count, unsigned int flags) { /* don't send partial responses, we're just yielding to avoid CPU spikes */ - if (appctx->st1 & APPCTX_CLI_ST1_YIELD) + if (appctx->st1 & APPCTX_CLI_ST1_YIELD) { + applet_have_no_more_data(appctx); return 0; + } return b_xfer(buf, &appctx->outbuf, MIN(count, b_data(&appctx->outbuf))); }