]> git.kaiwu.me - nginx.git/commitdiff
Mail: fixed worker_shutdown_timeout during Auth-Wait
authorVadim Zhestikov <v.zhestikov@f5.com>
Tue, 20 Oct 2026 22:31:16 +0000 (15:31 -0700)
committerSergey Kandaurov <pluknet@nginx.com>
Fri, 27 Nov 2026 14:19:10 +0000 (18:19 +0400)
The worker_shutdown_timeout directive did not work for mail connections
with an auth server that keeps returning Auth-Wait.  The fix is to add
c->close handling similar to ngx_mail_proxy_handler().

src/mail/ngx_mail_auth_http_module.c

index 661310c18d7d9a39f665f2d579a579bf47ad9347..e5c874fa9d463aac2de0e9eee0f3595a615539ed 100644 (file)
@@ -873,6 +873,12 @@ ngx_mail_auth_sleep_handler(ngx_event_t *rev)
     c = rev->data;
     s = c->data;
 
+    if (c->close) {
+        ngx_log_error(NGX_LOG_INFO, c->log, 0, "shutdown timeout");
+        ngx_mail_close_connection(c);
+        return;
+    }
+
     if (rev->timedout) {
 
         rev->timedout = 0;