From 1b8ffa19772a9f418fe45d088f4a475fc1e28d37 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 19 Apr 2022 11:31:05 +0300 Subject: [PATCH] auth: Fix assert-crash when handling user iteration in busy auth-workers The auth process crashed during user iteration if some auth requests were also queued. Broken by f591498845fd7b5e11f1085b6e1f5e34dcc84767 Fixes: Panic: file auth-worker-connection.c: line 128 (auth_worker_request_send): assertion failed: (worker->request == NULL) --- src/auth/auth-worker-connection.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/auth/auth-worker-connection.c b/src/auth/auth-worker-connection.c index 0794b7694d..d2c1610eaa 100644 --- a/src/auth/auth-worker-connection.c +++ b/src/auth/auth-worker-connection.c @@ -433,14 +433,18 @@ static int worker_input_args(struct connection *conn, const char *const *args) return -1; } - if (worker->restart) { + if (worker->request != NULL) { + /* there's still a pending request */ + } else if (worker->restart) { auth_worker_deinit(&worker, "Max requests limit", TRUE); ret = 0; } else if (worker->shutdown) { auth_worker_deinit(&worker, "Idle kill", FALSE); ret = 0; - } else if (worker->request != NULL) + } else { auth_worker_request_send_next(worker); + ret = 1; + } return ret; } -- 2.47.3