Improve shutdown signal safeness

The signal handler no longer acquires the service list lock which removes
a number of deadlock possibilities from the shutdown process. Instead, a
global shutdown flag is set that serves the same purpose as the individual
service shutdown flags did.
This commit is contained in:
Markus Mäkelä
2018-08-01 12:59:01 +03:00
parent 8a248dd930
commit 359f61c73b
5 changed files with 11 additions and 14 deletions

View File

@ -944,7 +944,7 @@ static int get_users(SERV_LISTENER *listener, bool skip_local)
int total_users = -1;
bool no_active_servers = true;
for (server = service->dbref; !service->svc_do_shutdown && server; server = server->next)
for (server = service->dbref; !service_should_stop && server; server = server->next)
{
if (!SERVER_REF_IS_ACTIVE(server) || !server_is_active(server->server) ||
(skip_local && server_is_mxs_service(server->server)))