Fix data race in SYSTEM STOP LISTEN

This commit is contained in:
Nikolay Degterinsky 2023-09-22 20:20:21 +00:00 committed by Alexey Milovidov
parent b8695525ad
commit bb0375d970

View File

@ -1516,11 +1516,13 @@ try
global_context->setStopServersCallback([&](const ServerType & server_type) global_context->setStopServersCallback([&](const ServerType & server_type)
{ {
std::lock_guard lock(servers_lock);
stopServers(servers, server_type); stopServers(servers, server_type);
}); });
global_context->setStartServersCallback([&](const ServerType & server_type) global_context->setStartServersCallback([&](const ServerType & server_type)
{ {
std::lock_guard lock(servers_lock);
createServers( createServers(
config(), config(),
listen_hosts, listen_hosts,