From e658dca4feaa9aa8493f4ba4db73a0efcd640cd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 8 Jul 2019 11:31:09 +0300 Subject: [PATCH] Allow rapid reloading of users on startup This fixes the test failures that stem from users being created right after maxscale has started. This also should make startups a bit smoother now that the default value of users_refresh_time has been fixed. --- server/core/service.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/core/service.cc b/server/core/service.cc index ad8556e80..e41b40e2f 100644 --- a/server/core/service.cc +++ b/server/core/service.cc @@ -1433,8 +1433,10 @@ bool Service::refresh_users() MXS_CONFIG* config = config_get_global_options(); - /* Check if refresh rate limit has been exceeded */ - if (now < m_rate_limits[self].last + config->users_refresh_time) + /* Check if refresh rate limit has been exceeded. Also check whether we are in the middle of starting up. + * If so, allow repeated reloading of users. */ + if (now > maxscale_started() + config->users_refresh_time + && now < m_rate_limits[self].last + config->users_refresh_time) { if (!m_rate_limits[self].warned) {