BUG/MINOR: applet: Don't trigger BUG_ON if the tid is not on appctx init
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 16 Jul 2025 09:29:49 +0000 (11:29 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Oct 2025 14:18:45 +0000 (16:18 +0200)
commit655499b9cb0f720bbfaeff039be0d26b5110dba3
treeecb6b78e6f7dbb7f132db4a05d1e132eadfdc6ac
parentb0bb6ac98ac2e979a1f4b301dd981783a227512c
BUG/MINOR: applet: Don't trigger BUG_ON if the tid is not on appctx init

When an appctx is initialized, there is a BUG_ON() to be sure the appctx is
really initialized on the right thread to avoid bugs on the thread
affinity. However, it is possible to not choose the thread when the appctx
is created and let it starts on any thread. In that case, the thread
affinity is set when the appctx is initialized. So, we must take cate to not
trigger the BUG_ON() in that case.

For now, we never hit the bug because the thread affinity is always set
during the appctx creation.

This patch must be backport as far as 2.8.

(cherry picked from commit 4f7c26cbb33fac44b255c714610191ffad2ec653)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
(cherry picked from commit be0148c5ccbe5711c201020b1eba2af297acacf6)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 0b854dfaf028a8836e3e460738370ef7210f1854)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/applet.h