aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/zenserverprocess.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-03-17 18:09:48 +0100
committerStefan Boberg <[email protected]>2026-03-17 18:11:03 +0100
commita754ae7468ac21b40d4971cca6c6dfa9183e9570 (patch)
treeced3a0c4bd4c5660919ba73d43cc349b990d1686 /src/zenutil/zenserverprocess.cpp
parentchangelog (diff)
downloadzen-a754ae7468ac21b40d4971cca6c6dfa9183e9570.tar.xz
zen-a754ae7468ac21b40d4971cca6c6dfa9183e9570.zip
Fix silent exit when second zenserver instance detects port conflict
ZEN_WARN/INFO/CRITICAL calls before InitializeLogging() are silently discarded. Switch all log calls in ZenServerMain::Run() that precede InitializeLogging() — the ZenServerState early-exit block, the lock file retry block, and the catch handlers — to their ZEN_CONSOLE_* equivalents. Also fix the same issue in ZenServerState::Sweep() and Snapshot() which had been inconsistently converted to fprintf+std::format.
Diffstat (limited to 'src/zenutil/zenserverprocess.cpp')
-rw-r--r--src/zenutil/zenserverprocess.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/zenutil/zenserverprocess.cpp b/src/zenutil/zenserverprocess.cpp
index b9c50be4f..49472cc1a 100644
--- a/src/zenutil/zenserverprocess.cpp
+++ b/src/zenutil/zenserverprocess.cpp
@@ -368,14 +368,16 @@ ZenServerState::Sweep()
{
if (ErrorCode)
{
- ZEN_WARN("Sweep - can not determine running state for pid {}, skipping entry (port {}). Reason: '{}'",
- Entry.Pid.load(),
- Entry.DesiredListenPort.load(),
- ErrorCode.message());
+ ZEN_CONSOLE_WARN("Sweep - can not determine running state for pid {}, skipping entry (port {}). Reason: '{}'",
+ Entry.Pid.load(),
+ Entry.DesiredListenPort.load(),
+ ErrorCode.message());
}
else
{
- ZEN_DEBUG("Sweep - pid {} not running, reclaiming entry (port {})", Entry.Pid.load(), Entry.DesiredListenPort.load());
+ ZEN_CONSOLE_DEBUG("Sweep - pid {} not running, reclaiming entry (port {})",
+ Entry.Pid.load(),
+ Entry.DesiredListenPort.load());
Entry.Reset();
}
}
@@ -402,10 +404,10 @@ ZenServerState::Snapshot(std::function<void(const ZenServerEntry&)>&& Callback)
{
if (ErrorCode)
{
- ZEN_WARN("Snapshot - can not determine running state for pid {}, skipping entry (port {}). Reason: '{}'",
- Entry.Pid.load(),
- Entry.DesiredListenPort.load(),
- ErrorCode.message());
+ ZEN_CONSOLE_WARN("Snapshot - can not determine running state for pid {}, skipping entry (port {}). Reason: '{}'",
+ Entry.Pid.load(),
+ Entry.DesiredListenPort.load(),
+ ErrorCode.message());
}
else
{