diff --git a/programs/server/Server.cpp b/programs/server/Server.cpp index a968acb549f..78f3f749d9a 100644 --- a/programs/server/Server.cpp +++ b/programs/server/Server.cpp @@ -1516,11 +1516,13 @@ try global_context->setStopServersCallback([&](const ServerType & server_type) { + std::lock_guard lock(servers_lock); stopServers(servers, server_type); }); global_context->setStartServersCallback([&](const ServerType & server_type) { + std::lock_guard lock(servers_lock); createServers( config(), listen_hosts,