aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/main.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-11-15 11:30:56 +0100
committerGitHub <[email protected]>2023-11-15 11:30:56 +0100
commitd02b0720813a62a4f1fe875e6e784843f5c2da46 (patch)
tree31768a0f52793b0205f156c0b827f11decc2c479 /src/zenserver/main.cpp
parentadd host name to sentry (#537) (diff)
downloadzen-d02b0720813a62a4f1fe875e6e784843f5c2da46.tar.xz
zen-d02b0720813a62a4f1fe875e6e784843f5c2da46.zip
fix race contdition when signaling shutdown of process and waiting for completion (#539)
Diffstat (limited to 'src/zenserver/main.cpp')
-rw-r--r--src/zenserver/main.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp
index 69cc2bbf5..44330d4c8 100644
--- a/src/zenserver/main.cpp
+++ b/src/zenserver/main.cpp
@@ -198,13 +198,15 @@ ZenEntryPoint::Run()
ShutdownThread.reset(new std::thread{[&] {
SetCurrentThreadName("shutdown_monitor");
- ZEN_INFO("shutdown monitor thread waiting for shutdown signal '{}'", ShutdownEventName);
+ ZEN_INFO("shutdown monitor thread waiting for shutdown signal '{}' for process {}",
+ ShutdownEventName,
+ zen::GetCurrentProcessId());
if (ShutdownEvent->Wait())
{
if (!IsApplicationExitRequested())
{
- ZEN_INFO("shutdown signal received");
+ ZEN_INFO("shutdown signal for pid {} received", zen::GetCurrentProcessId());
Server.RequestExit(0);
}
}
@@ -244,7 +246,7 @@ ZenEntryPoint::Run()
}
catch (std::exception& e)
{
- ZEN_CRITICAL("Caught exception in main: {}", e.what());
+ ZEN_CRITICAL("Caught exception in main for process {}: {}", zen::GetCurrentProcessId(), e.what());
if (!IsApplicationExitRequested())
{
RequestApplicationExit(1);