BUG/MEDIUM: apppet: Improve spinning loop detection with the new API
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 10 Oct 2025 12:32:04 +0000 (14:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Oct 2025 16:16:16 +0000 (18:16 +0200)
commitbcaee0d7f05a47979cff8e7ba7f6baebdf103e05
tree29f3e6e39af02b25dc33db957fe3acebc378fabe
parent696514866998bdc1d97158aa79d9ee65d2f7707d
BUG/MEDIUM: apppet: Improve spinning loop detection with the new API

Conditions to detect the spinning loop for applets based on the new API are
not accurrate. We cannot continue to check the channel's buffers state to
know if an applet has made some progress. At least, we must also check the
applet's buffers.

After digging to find the right way to do, it was clear that the best is to
use something similar to what is performed for the streams, namely, checking
read and write events. And in fact, it is quite easy to do with the new
API. So let's do so.

This patch must be backported as far as 3.0.

(cherry picked from commit 54b7539d64d70f033955a0bfe7d0f19d7eef2328)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 20623769917780b8fb7a01a7aa1a2539cc60961b)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit ff753da75357e2595d69570b455f8c782297eb27)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/applet.c