diff options
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | src/zenserver/main.cpp | 16 |
2 files changed, 11 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 86592d471..8ef0f15e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## - Improvement: If `zen builds upload` fails to upload metadata for a block with a 404 response (due to race condition from hitting different server) we save and retry metadata upload at end of upload - Improvement: Updated Oodle libs to 2.9.14 +- Bugfix: Parents were not notified when successfully attaching to an existing server instance ## 5.6.13 - Feature: Added `--sentry-environment` to `zen` and `zenserver` diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp index b0d945814..6d9a478be 100644 --- a/src/zenserver/main.cpp +++ b/src/zenserver/main.cpp @@ -117,6 +117,14 @@ ZenEntryPoint::Run() ServerState.Initialize(); ServerState.Sweep(); + auto NotifyReady = [&] { + if (!m_ServerOptions.ChildId.empty()) + { + NamedEvent ParentEvent{m_ServerOptions.ChildId}; + ParentEvent.Set(); + } + }; + uint32_t AttachSponsorProcessRetriesLeft = 3; ZenServerState::ZenServerEntry* Entry = ServerState.Lookup(m_ServerOptions.BasePort); while (Entry) @@ -155,6 +163,7 @@ ZenEntryPoint::Run() // Sponsor processes are checked every second, so 2 second wait time should be enough if (Entry->AddSponsorProcess(m_ServerOptions.OwnerPid, 2000)) { + NotifyReady(); std::exit(0); } if (AttachSponsorProcessRetriesLeft-- > 0) @@ -294,12 +303,7 @@ ZenEntryPoint::Run() Server.SetIsReadyFunc([&] { m_LockFile.Update(MakeLockData(true), Ec); - - if (!m_ServerOptions.ChildId.empty()) - { - NamedEvent ParentEvent{m_ServerOptions.ChildId}; - ParentEvent.Set(); - } + NotifyReady(); }); Server.Run(); |