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.
* the appctx will be fully initialized. The session and the stream will
* eventually be created. The affinity must be set now !
*/
- BUG_ON(appctx->t->tid != tid);
+ BUG_ON(appctx->t->tid != -1 && appctx->t->tid != tid);
task_set_thread(appctx->t, tid);
if (appctx->applet->init)