diff --git a/src/cli.c b/src/cli.c index b331bd3e5..90320c2e9 100644 --- a/src/cli.c +++ b/src/cli.c @@ -2669,6 +2669,7 @@ int mworker_cli_sockpair_new(struct mworker_proc *mworker_proc, int proc) l->accept = session_accept_fd; l->default_target = global.stats_fe->default_target; l->options |= (LI_O_UNLIMITED | LI_O_NOSTOP); + HA_ATOMIC_ADD(&unstoppable_jobs, 1); /* it's a sockpair but we don't want to keep the fd in the master */ l->rx.flags &= ~RX_F_INHERITED; l->nice = -64; /* we want to boost priority for local stats */ diff --git a/src/proxy.c b/src/proxy.c index 7b000bb23..058e33131 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1301,10 +1301,8 @@ void stop_proxy(struct proxy *p) HA_SPIN_LOCK(PROXY_LOCK, &p->lock); list_for_each_entry(l, &p->conf.listeners, by_fe) { - if (l->options & LI_O_NOSTOP) { - HA_ATOMIC_ADD(&unstoppable_jobs, 1); + if (l->options & LI_O_NOSTOP) continue; - } /* There are several cases where we must not close an FD: * - we're starting up and we have socket transfers enabled;