]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
master: Don't wait only for log process at shutdown
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sun, 11 Dec 2022 21:15:09 +0000 (23:15 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 13 Dec 2022 09:56:41 +0000 (09:56 +0000)
There is 1 second wait at shutdown for processes that are still running.
During this 1 second they should process SIGQUIT and close socket listeners.
However, it's normal behavior for the log process to still exist at this
stage, and there is no need to wait for it.

src/master/service-monitor.c

index 42422330b3ed3b1bb8d259edf4e1cd96e25450fe..a762d83c4e60d15e6c6e2c59806533e9ec2dc08b 100644 (file)
@@ -641,8 +641,17 @@ service_list_processes_close_listeners(struct service_list *service_list)
        bool ret = FALSE;
 
        array_foreach_elem(&service_list->services, service) {
-               if (service_processes_close_listeners(service))
-                       ret = TRUE;
+               if (service_processes_close_listeners(service)) {
+                       if (service->type != SERVICE_TYPE_LOG)
+                               ret = TRUE;
+                       else {
+                               /* The log process won't stop until we close its
+                                  fds later on. Send a SIGQUIT to it anyway
+                                  just in case it's stuck for some reason, but
+                                  don't wait for it to be processed. This way
+                                  there is no unnecessary 1sec wait. */
+                       }
+               }
        }
        return ret;
 }