]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
master: Wait 1 second for SIGQUITs to get handled
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Mon, 20 Aug 2018 22:07:30 +0000 (18:07 -0400)
committerJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Mon, 20 Aug 2018 22:07:30 +0000 (18:07 -0400)
The delay (previously 100ms, now 1s) is intended to delay our exit enough so
that the child processes have a chance to receive & handle the SIGQUITs we
just sent.  If we don't wait long enough, it is possible that we'll get
restarted before our children had the chance to stop listening on their
sockets and we'll hit "address already in use" type errors.

Increasing the delay does not fix the issue, but it masks it better.

src/master/service-monitor.c

index 7f1f2451a35f3a7279f4484aad53ee386aa536e2..a1d9795dbf07d4c74adc18b2863c07eae4137a95 100644 (file)
@@ -631,7 +631,7 @@ static void services_monitor_wait_and_kill(struct service_list *service_list)
        if (service_list_processes_close_listeners(service_list)) {
                /* SIGQUITs were sent. wait a little bit to make sure they're
                   also processed before quitting. */
-               usleep(100000);
+               usleep(1000000);
        }
 }