From: Willy Tarreau Date: Thu, 12 Mar 2020 16:33:29 +0000 (+0100) Subject: BUG/MINOR: listener/mq: do not dispatch connections to remote threads when stopping X-Git-Tag: v2.2-dev5~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7da5e8dd058ee1e283a06342e9701a8eca78ac6;p=thirdparty%2Fhaproxy.git BUG/MINOR: listener/mq: do not dispatch connections to remote threads when stopping When stopping there is a risk that other threads are already in the process of stopping, so let's not add new work in their queue and instead keep the incoming connection local. This should be backported to 2.1 and 2.0. --- diff --git a/src/listener.c b/src/listener.c index e9a4bee1a4..ceb52af0d5 100644 --- a/src/listener.c +++ b/src/listener.c @@ -896,7 +896,7 @@ void listener_accept(int fd) #if defined(USE_THREAD) mask = thread_mask(l->bind_conf->bind_thread) & all_threads_mask; - if (atleast2(mask) && (global.tune.options & GTUNE_LISTENER_MQ)) { + if (atleast2(mask) && (global.tune.options & GTUNE_LISTENER_MQ) && !stopping) { struct accept_queue_ring *ring; unsigned int t, t0, t1, t2;