From aa0b0d3cbfc6c4561591df856396703f7177292e Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Sat, 20 Apr 2024 13:22:05 +0200 Subject: import oplog improvements (#54) * report down/up transfer speed during progress * add disk buffering in http client * offload block decoding and chunk writing form network worker pool threads add block hash verification for blocks recevied at oplog import * separate download-latch from write-latch to get more accurate download speed * check headers when downloading with http client to go directly to file writing for large payloads * we must clear write callback even if we only provide it as an argument to the Download() call * make timeout optional in AddSponsorProcess * check return codes when creating windows threadpool --- src/zenutil/zenserverprocess.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/zenutil/zenserverprocess.cpp') diff --git a/src/zenutil/zenserverprocess.cpp b/src/zenutil/zenserverprocess.cpp index f5bc088a5..34eec9790 100644 --- a/src/zenutil/zenserverprocess.cpp +++ b/src/zenutil/zenserverprocess.cpp @@ -403,7 +403,7 @@ ZenServerState::ZenServerEntry::IsReady() const } bool -ZenServerState::ZenServerEntry::AddSponsorProcess(uint32_t PidToAdd) +ZenServerState::ZenServerEntry::AddSponsorProcess(uint32_t PidToAdd, uint64_t Timeout) { uint32_t ServerPid = Pid.load(); auto WaitForPickup = [&](uint32_t AddedSlotIndex) { @@ -427,13 +427,13 @@ ZenServerState::ZenServerEntry::AddSponsorProcess(uint32_t PidToAdd) { if (SponsorPids[SponsorIndex].load(std::memory_order_relaxed) == PidToAdd) { - return WaitForPickup(SponsorIndex); + return Timeout == 0 ? true : WaitForPickup(SponsorIndex); } uint32_t Expected = 0; if (SponsorPids[SponsorIndex].compare_exchange_strong(Expected, PidToAdd)) { // Success! - return WaitForPickup(SponsorIndex); + return Timeout == 0 ? true : WaitForPickup(SponsorIndex); } } @@ -865,6 +865,8 @@ ZenServerInstance::OnServerReady() m_BasePort = Entry->EffectiveListenPort; CreateShutdownEvent(m_BasePort); + + ZEN_DEBUG("Server '{}' is ready on port {}", m_Name, m_BasePort); } std::string -- cgit v1.2.3