From: Willy Tarreau Date: Thu, 31 Aug 2023 15:51:00 +0000 (+0200) Subject: MINOR: checks: also consider the thread's queue for rebalancing X-Git-Tag: v2.9-dev5~77 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b0031d9679d244d4c9057e6a7a7b0b2142147806;p=thirdparty%2Fhaproxy.git MINOR: checks: also consider the thread's queue for rebalancing Let's also check for other threads when the current one is queueing, let's not wait for the load to be high. Now this totally eliminates differences between threads. --- diff --git a/src/check.c b/src/check.c index de8ffc3763..86af008747 100644 --- a/src/check.c +++ b/src/check.c @@ -1205,7 +1205,8 @@ struct task *process_chk_conn(struct task *t, void *context, unsigned int state) * other thread. */ while (attempts-- > 0 && - my_load >= 3 && _HA_ATOMIC_LOAD(&th_ctx->active_checks) >= 3) { + (!LIST_ISEMPTY(&th_ctx->queued_checks) || my_load >= 3) && + _HA_ATOMIC_LOAD(&th_ctx->active_checks) >= 3) { uint new_tid = statistical_prng_range(global.nbthread); if (new_tid == tid)