From: Karl Fleischmann Date: Thu, 8 Feb 2024 16:08:34 +0000 (+0100) Subject: master: Default service_restart_request_count to SET_UINT_UNLIMITED X-Git-Tag: 2.4.1~1038 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b94c17db00b08e59766a769fed70e846aef78f0;p=thirdparty%2Fdovecot%2Fcore.git master: Default service_restart_request_count to SET_UINT_UNLIMITED Replace the implicit meaning of 0 as unlimited with the explicitly named value. --- diff --git a/src/master/master-settings.c b/src/master/master-settings.c index 666dee5104..5085cd1eb6 100644 --- a/src/master/master-settings.c +++ b/src/master/master-settings.c @@ -164,7 +164,7 @@ static const struct service_settings service_default_settings = { .process_min_avail = 0, .process_limit = 100, .client_limit = 1000, - .restart_request_count = 0, + .restart_request_count = SET_UINT_UNLIMITED, .idle_kill = 60, .vsz_limit = 256*1024*1024, @@ -687,6 +687,12 @@ master_settings_ext_check(struct event *event, void *_set, service->name); return FALSE; } + if (service->restart_request_count == 0) { + *error_r = t_strdup_printf("service(%s): " + "restart_request_count must be higher than 0", + service->name); + return FALSE; + } if (service->idle_kill == 0) { *error_r = t_strdup_printf("service(%s): " "idle_kill must be higher than 0", diff --git a/src/master/service.c b/src/master/service.c index 0aceedcac8..3dbd21519a 100644 --- a/src/master/service.c +++ b/src/master/service.c @@ -206,8 +206,8 @@ service_create_real(pool_t pool, struct event *event, service->throttle_msecs = SERVICE_STARTUP_FAILURE_THROTTLE_MIN_MSECS; service->client_limit = set->client_limit; - if (set->restart_request_count > 0 && - service->client_limit > set->restart_request_count) + i_assert(set->restart_request_count > 0); + if (service->client_limit > set->restart_request_count) service->client_limit = set->restart_request_count; service->vsz_limit = set->vsz_limit;