aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/zenhttp/httpclientauth.cpp2
-rw-r--r--src/zenhttp/servers/httpparser.cpp9
-rw-r--r--src/zenserver/compute/computeserver.cpp6
-rw-r--r--src/zenserver/hub/zenhubserver.cpp2
-rw-r--r--src/zenserver/zenserver.cpp2
-rw-r--r--src/zenstore/gc.cpp7
-rw-r--r--src/zenstore/include/zenstore/gc.h2
7 files changed, 18 insertions, 12 deletions
diff --git a/src/zenhttp/httpclientauth.cpp b/src/zenhttp/httpclientauth.cpp
index 72df12d02..02e1b57e2 100644
--- a/src/zenhttp/httpclientauth.cpp
+++ b/src/zenhttp/httpclientauth.cpp
@@ -170,7 +170,7 @@ namespace zen { namespace httpclientauth {
time_t UTCTime = timegm(&Time);
HttpClientAccessToken::TimePoint ExpireTime = std::chrono::system_clock::from_time_t(UTCTime);
- ExpireTime += std::chrono::microseconds(Millisecond);
+ ExpireTime += std::chrono::milliseconds(Millisecond);
return HttpClientAccessToken{.Value = fmt::format("Bearer {}"sv, Token), .ExpireTime = ExpireTime};
}
diff --git a/src/zenhttp/servers/httpparser.cpp b/src/zenhttp/servers/httpparser.cpp
index be5befcd2..f0485aa25 100644
--- a/src/zenhttp/servers/httpparser.cpp
+++ b/src/zenhttp/servers/httpparser.cpp
@@ -226,6 +226,8 @@ NormalizeUrlPath(std::string_view InUrl, std::string& NormalizedUrl)
NormalizedUrl.append(Url, UrlIndex);
}
+ // NOTE: this check is redundant given the enclosing if,
+ // need to verify the intent of this code
if (!LastCharWasSeparator)
{
NormalizedUrl.push_back('/');
@@ -310,6 +312,7 @@ HttpRequestParser::OnHeadersComplete()
if (ContentLength)
{
+ // TODO: should sanity-check content length here
m_BodyBuffer = IoBuffer(ContentLength);
}
@@ -329,9 +332,9 @@ HttpRequestParser::OnHeadersComplete()
int
HttpRequestParser::OnBody(const char* Data, size_t Bytes)
{
- if (m_BodyPosition + Bytes > m_BodyBuffer.Size())
+ if ((m_BodyPosition + Bytes) > m_BodyBuffer.Size())
{
- ZEN_WARN("HTTP parser incoming body is larger than content size, need {} more bytes",
+ ZEN_WARN("HTTP parser incoming body is larger than content size, need {} more buffer bytes",
(m_BodyPosition + Bytes) - m_BodyBuffer.Size());
return 1;
}
@@ -342,7 +345,7 @@ HttpRequestParser::OnBody(const char* Data, size_t Bytes)
{
if (m_BodyPosition != m_BodyBuffer.Size())
{
- ZEN_WARN("Body mismatch! {} != {}", m_BodyPosition, m_BodyBuffer.Size());
+ ZEN_WARN("Body size mismatch! {} != {}", m_BodyPosition, m_BodyBuffer.Size());
return 1;
}
}
diff --git a/src/zenserver/compute/computeserver.cpp b/src/zenserver/compute/computeserver.cpp
index 173f56386..0f9ef0287 100644
--- a/src/zenserver/compute/computeserver.cpp
+++ b/src/zenserver/compute/computeserver.cpp
@@ -82,7 +82,7 @@ ZenComputeServer::Initialize(const ZenComputeServerConfig& ServerConfig, ZenServ
ZEN_TRACE_CPU("ZenComputeServer::Initialize");
ZEN_MEMSCOPE(GetZenserverTag());
- ZEN_INFO(ZEN_APP_NAME " initializing in HUB server mode");
+ ZEN_INFO(ZEN_APP_NAME " initializing in COMPUTE server mode");
const int EffectiveBasePort = ZenServerBase::Initialize(ServerConfig, ServerEntry);
if (EffectiveBasePort < 0)
@@ -91,7 +91,7 @@ ZenComputeServer::Initialize(const ZenComputeServerConfig& ServerConfig, ZenServ
}
// This is a workaround to make sure we can have automated tests. Without
- // this the ranges for different child zen hub processes could overlap with
+ // this the ranges for different child zen compute processes could overlap with
// the main test range.
ZenServerEnvironment::SetBaseChildId(1000);
@@ -109,7 +109,7 @@ ZenComputeServer::Initialize(const ZenComputeServerConfig& ServerConfig, ZenServ
void
ZenComputeServer::Cleanup()
{
- ZEN_TRACE_CPU("ZenStorageServer::Cleanup");
+ ZEN_TRACE_CPU("ZenComputeServer::Cleanup");
ZEN_INFO(ZEN_APP_NAME " cleaning up");
try
{
diff --git a/src/zenserver/hub/zenhubserver.cpp b/src/zenserver/hub/zenhubserver.cpp
index 7a4ba951d..d0a0db417 100644
--- a/src/zenserver/hub/zenhubserver.cpp
+++ b/src/zenserver/hub/zenhubserver.cpp
@@ -105,7 +105,7 @@ ZenHubServer::Initialize(const ZenHubServerConfig& ServerConfig, ZenServerState:
void
ZenHubServer::Cleanup()
{
- ZEN_TRACE_CPU("ZenStorageServer::Cleanup");
+ ZEN_TRACE_CPU("ZenHubServer::Cleanup");
ZEN_INFO(ZEN_APP_NAME " cleaning up");
try
{
diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp
index 7bf6126df..5fd35d9b4 100644
--- a/src/zenserver/zenserver.cpp
+++ b/src/zenserver/zenserver.cpp
@@ -617,6 +617,8 @@ ZenServerMain::Run()
{
ZEN_INFO(ZEN_APP_NAME " unable to grab lock at '{}' (reason: '{}'), retrying", LockFilePath, Ec.message());
Sleep(500);
+
+ m_LockFile.Create(LockFilePath, MakeLockData(false), Ec);
if (Ec)
{
ZEN_WARN(ZEN_APP_NAME " exiting, unable to grab lock at '{}' (reason: '{}')", LockFilePath, Ec.message());
diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp
index 14caa5abf..c3bdc59f0 100644
--- a/src/zenstore/gc.cpp
+++ b/src/zenstore/gc.cpp
@@ -1494,7 +1494,8 @@ GcManager::CollectGarbage(const GcSettings& Settings)
GcReferenceValidatorStats& Stats = Result.ReferenceValidatorStats[It.second].second;
try
{
- // Go through all the ReferenceCheckers to see if the list of Cids the collector selected are referenced or
+ // Go through all the ReferenceCheckers to see if the list of Cids the collector selected
+ // are referenced or not
SCOPED_TIMER(Stats.ElapsedMS = std::chrono::milliseconds(Timer.GetElapsedTimeMs()););
ReferenceValidator->Validate(Ctx, Stats);
}
@@ -1952,7 +1953,7 @@ GcScheduler::AppendGCLog(std::string_view Id, GcClock::TimePoint StartTime, cons
Writer << "SingleThread"sv << Settings.SingleThread;
Writer << "CompactBlockUsageThresholdPercent"sv << Settings.CompactBlockUsageThresholdPercent;
Writer << "AttachmentRangeMin"sv << Settings.AttachmentRangeMin;
- Writer << "AttachmentRangeMax"sv << Settings.AttachmentRangeMin;
+ Writer << "AttachmentRangeMax"sv << Settings.AttachmentRangeMax;
Writer << "ForceStoreCacheAttachmentMetaData"sv << Settings.StoreCacheAttachmentMetaData;
Writer << "ForceStoreProjectAttachmentMetaData"sv << Settings.StoreProjectAttachmentMetaData;
Writer << "EnableValidation"sv << Settings.EnableValidation;
@@ -2893,7 +2894,7 @@ GcScheduler::CollectGarbage(const GcClock::TimePoint& CacheExpireTime,
{
m_LastFullGCV2Result = Result;
m_LastFullAttachmentRangeMin = AttachmentRangeMin;
- m_LastFullAttachmentRangeMin = AttachmentRangeMax;
+ m_LastFullAttachmentRangeMax = AttachmentRangeMax;
}
Diff.DiskSize = Result.CompactStoresStatSum.RemovedDisk;
Diff.MemorySize = Result.ReferencerStatSum.RemoveExpiredDataStats.FreedMemory;
diff --git a/src/zenstore/include/zenstore/gc.h b/src/zenstore/include/zenstore/gc.h
index 734d2e5a7..794f50d96 100644
--- a/src/zenstore/include/zenstore/gc.h
+++ b/src/zenstore/include/zenstore/gc.h
@@ -238,7 +238,7 @@ bool FilterReferences(GcCtx& Ctx, std::string_view Context, std::vector<IoHa
/**
* @brief An interface to implement a lock for Stop The World (from writing new data)
*
- * This interface is registered/unregistered to GcManager vua AddGcReferenceLocker() and RemoveGcReferenceLockerr()
+ * This interface is registered/unregistered to GcManager via AddGcReferenceLocker() and RemoveGcReferenceLocker()
*/
class GcReferenceLocker
{