From 034459cb66580d0aa680ae96a18b5a884808386c Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Wed, 3 Apr 2024 12:32:34 +0200 Subject: zenremoteprojectstore with httpclient (#35) - Bugfix: Fix log of Success/Failure for oplog import - Improvement: Use HttpClient when doing oplog export/import with a zenserver as a remote target. Includes retry logic - Improvement: Increase the retry count to 4 (5 attempts in total) when talking to Jupiter for oplog export/import --- src/zenserver/projectstore/remoteprojectstore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/zenserver/projectstore/remoteprojectstore.cpp') diff --git a/src/zenserver/projectstore/remoteprojectstore.cpp b/src/zenserver/projectstore/remoteprojectstore.cpp index ae4777278..e11541534 100644 --- a/src/zenserver/projectstore/remoteprojectstore.cpp +++ b/src/zenserver/projectstore/remoteprojectstore.cpp @@ -2658,7 +2658,7 @@ LoadOplog(CidStore& ChunkStore, ReportMessage(OptionalContext, fmt::format("Loaded oplog '{}' {} in {} ({}), Blocks: {} ({}), Attachments: {} ({}), Stored: {} ({}), Missing: {}", RemoteStoreInfo.ContainerName, - RemoteResult.GetError() == 0 ? "SUCCESS" : "FAILURE", + Result.ErrorCode == 0 ? "SUCCESS" : "FAILURE", NiceTimeSpanMs(static_cast(Result.ElapsedSeconds * 1000.0)), NiceBytes(Info.OplogSizeBytes), Info.AttachmentBlocksDownloaded.load(), -- cgit v1.2.3 From 12b7bf1c16f671c83840961c37a339141a7ffbb3 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 4 Apr 2024 14:32:40 +0200 Subject: improved assert (#37) - Improvement: Add file and line to ASSERT exceptions - Improvement: Catch call stack when throwing assert exceptions and log/output call stack at important places to provide more context to caller --- src/zenserver/projectstore/remoteprojectstore.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/zenserver/projectstore/remoteprojectstore.cpp') diff --git a/src/zenserver/projectstore/remoteprojectstore.cpp b/src/zenserver/projectstore/remoteprojectstore.cpp index e11541534..8efb92e6b 100644 --- a/src/zenserver/projectstore/remoteprojectstore.cpp +++ b/src/zenserver/projectstore/remoteprojectstore.cpp @@ -835,7 +835,7 @@ BuildContainer(CidStore& ChunkStore, } } } - catch (std::exception& Ex) + catch (const std::exception& Ex) { RemoteResult.SetError(gsl::narrow(HttpResponseCode::NotFound), fmt::format("Failed to resolve attachment {}", RawHash), @@ -1216,7 +1216,7 @@ BuildContainer(CidStore& ChunkStore, return {}; } } - catch (std::exception& Ex) + catch (const std::exception& Ex) { BlockCreateLatch.CountDown(); while (!BlockCreateLatch.Wait(1000)) @@ -1740,7 +1740,7 @@ SaveOplog(CidStore& ChunkStore, CreatedBlocks.insert({BlockHash, std::move(BlockBuffer)}); ZEN_DEBUG("Saved temp block to '{}', {}", AttachmentTempPath, NiceBytes(BlockBuffer.GetSize())); } - catch (std::exception& Ex) + catch (const std::exception& Ex) { RemoteResult.SetError(gsl::narrow(HttpResponseCode::InternalServerError), Ex.what(), -- cgit v1.2.3