From: Timo Sirainen Date: Fri, 9 Oct 2009 21:42:33 +0000 (-0400) Subject: master: Allow idle-killing the last service process, except anvil. X-Git-Tag: 2.0.alpha1~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c0e5c6a86e1de5d4f5591d39b4aa921a23c807d7;p=thirdparty%2Fdovecot%2Fcore.git master: Allow idle-killing the last service process, except anvil. --HG-- branch : HEAD --- diff --git a/src/master/service-monitor.c b/src/master/service-monitor.c index 94d86c22a4..e3286f7b27 100644 --- a/src/master/service-monitor.c +++ b/src/master/service-monitor.c @@ -28,10 +28,8 @@ static void service_process_kill_idle(struct service_process *process) { struct service *service = process->service; - if (service->process_avail <= service->set->process_min_avail || - service->process_avail == 1) { - /* we don't have any extra idling processes. and if there's - no minimum limit, never kill the last process anyway */ + if (service->process_avail <= service->set->process_min_avail) { + /* we don't have any extra idling processes anymore. */ timeout_remove(&process->to_idle); } else { if (kill(process->pid, SIGINT) < 0 && errno != ESRCH) { @@ -79,7 +77,8 @@ static void service_status_less(struct service_process *process, if (status->available_count == service->client_limit) { process->idle_start = ioloop_time; if (service->process_avail > service->set->process_min_avail && - process->to_idle == NULL) { + process->to_idle == NULL && + service->type != SERVICE_TYPE_ANVIL) { /* we have more processes than we really need. add a bit of randomness so that we don't send the signal to all of them at once */