mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-05 04:56:10 +02:00
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.
This commit is contained in:
parent
dfdccbd2af
commit
0629ce8f4b
@ -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)));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user