diff options
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | src/zenserver/main.cpp | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 79cf0c050..a163129b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Improvement: Added support for request tracing when using asio path (use `--log-trace=http_requests` to enable) - Improvement: Large attachments and loose files are now split into smaller chunks and stored in blocks during oplog export - Improvement: Make sure zenserver reacts and exist on SIGTERM signal +- Improvement: Retry to create the .lock file at startup to avoid failing launch due to race condition with UE - Removed: `--cache-reference-cache-enabled` option has been removed along with the implementation for reference caching in disk cache ## 5.4.1 diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp index 01e142801..b4cb2464b 100644 --- a/src/zenserver/main.cpp +++ b/src/zenserver/main.cpp @@ -145,9 +145,15 @@ ZenEntryPoint::Run() if (Ec) { - ZEN_WARN("ERROR: Unable to grab lock at '{}' (error: '{}')", LockFilePath, Ec.message()); + ZEN_WARN("Unable to grab lock at '{}' (error: '{}'), retrying", LockFilePath, Ec.message()); + Sleep(500); - std::exit(99); + m_LockFile.Create(LockFilePath, MakeLockData(), Ec); + if (Ec) + { + ZEN_WARN("ERROR: Unable to grab lock at '{}' (error: '{}')", LockFilePath, Ec.message()); + std::exit(99); + } } InitializeServerLogging(m_ServerOptions); |