From: Christopher Faulet Date: Thu, 14 Mar 2024 09:49:01 +0000 (+0100) Subject: BUG/MINOR: spoe: Be sure to be able to quickly close IDLE applets on soft-stop X-Git-Tag: v3.0-dev6~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6547b1429287db162c9e9ac8945d75fb631843ee;p=thirdparty%2Fhaproxy.git BUG/MINOR: spoe: Be sure to be able to quickly close IDLE applets on soft-stop On soft-stop, we try, as far as possible, to process all pending messages before closing SPOE applets. However, in sync mode, when an applets waiting for a response receives the ACK frame, it is switched to IDLE state without checking if it may be closed. In this case, we will wait the idle timeout before closing de applet, delaying the soft-stop. To reduce this delay, on soft-stop, IDLE applets are woken up. On the next wakeup, the applet will try to process pending messages or will be closed. This patch should be backported to all stable versions. --- diff --git a/src/flt_spoe.c b/src/flt_spoe.c index cd65c0e49e..73d47247bf 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -2001,7 +2001,9 @@ spoe_handle_appctx(struct appctx *appctx) return; } out: - if (SPOE_APPCTX(appctx)->task->expire != TICK_ETERNITY) + if (stopping && appctx->st0 == SPOE_APPCTX_ST_IDLE) + task_wakeup(SPOE_APPCTX(appctx)->task, TASK_WOKEN_MSG); + else if (SPOE_APPCTX(appctx)->task->expire != TICK_ETERNITY) task_queue(SPOE_APPCTX(appctx)->task); }