]> git.ipfire.org Git - thirdparty/dovecot/core.git/commit
master: Fix idle-kill for processes with a single short-lived client
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 6 May 2021 11:29:03 +0000 (14:29 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Mon, 14 Jun 2021 13:44:01 +0000 (13:44 +0000)
commitda607df02a060491d45af2c809ab30e839275850
treeae7f2a9ad2d1a8f1f13143c119d15941a4b52e8f
parentbb618563b778fcb5d22307aaeca4111ca0e0e04a
master: Fix idle-kill for processes with a single short-lived client

lib-master sends unimportant service status updates to master only once per
second when client_limit>1, because within that 1 second the available client
count may have already changed many times. Normally this is fine, but there's a
problem with the initial client:

 * The client connection launches a new process
 * The process sends the initial status notification with available_count=MAX
 * The client connection is handled, but because the status notification was
   just sent, the update won't be sent until 1 second later
 * The client disconnects within the 1 second
 * The available_count is again MAX, so no status notification is sent

In this situation the master process never created the idle-kill timeout.
Usually the following clients will cause a status notification to be sent, but
if there was only the one client then this process won't be idle-killed. Fix the
situation so that the idle-kill timeout is created already by the initial status
notification.
src/master/service-monitor.c