aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-04-20 13:22:05 +0200
committerGitHub Enterprise <[email protected]>2024-04-20 13:22:05 +0200
commitaa0b0d3cbfc6c4561591df856396703f7177292e (patch)
tree6ff9a4e94559ba62d8ee07076d56dedc7d2e9115 /src/zenutil
parent5.4.5-pre0 (diff)
downloadzen-aa0b0d3cbfc6c4561591df856396703f7177292e.tar.xz
zen-aa0b0d3cbfc6c4561591df856396703f7177292e.zip
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
Diffstat (limited to 'src/zenutil')
-rw-r--r--src/zenutil/include/zenutil/zenserverprocess.h2
-rw-r--r--src/zenutil/zenserverprocess.cpp8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/zenutil/include/zenutil/zenserverprocess.h b/src/zenutil/include/zenutil/zenserverprocess.h
index 1bd00acb7..f7204fb43 100644
--- a/src/zenutil/include/zenutil/zenserverprocess.h
+++ b/src/zenutil/include/zenutil/zenserverprocess.h
@@ -168,7 +168,7 @@ public:
bool IsShutdownRequested() const;
void SignalReady();
bool IsReady() const;
- bool AddSponsorProcess(uint32_t Pid);
+ bool AddSponsorProcess(uint32_t Pid, uint64_t Timeout = 0);
};
static_assert(sizeof(ZenServerEntry) == 64);
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