diff options
Diffstat (limited to 'src')
3 files changed, 13 insertions, 15 deletions
diff --git a/src/zenremotestore/include/zenremotestore/projectstore/remoteprojectstore.h b/src/zenremotestore/include/zenremotestore/projectstore/remoteprojectstore.h index 604ecb6ab..88e756439 100644 --- a/src/zenremotestore/include/zenremotestore/projectstore/remoteprojectstore.h +++ b/src/zenremotestore/include/zenremotestore/projectstore/remoteprojectstore.h @@ -173,16 +173,17 @@ class JobContext; class RemoteStoreError : public std::runtime_error { public: - using _Mybase = runtime_error; - RemoteStoreError(const std::string& Message, int32_t ErrorCode, std::string_view Text) - : _Mybase(Message) + : std::runtime_error(Message) , m_ErrorCode(ErrorCode) , m_Text(Text) { } - RemoteStoreError(const char* Message, int32_t ErrorCode, std::string_view Text) : _Mybase(Message), m_ErrorCode(ErrorCode), m_Text(Text) + RemoteStoreError(const char* Message, int32_t ErrorCode, std::string_view Text) + : std::runtime_error(Message) + , m_ErrorCode(ErrorCode) + , m_Text(Text) { } diff --git a/src/zenremotestore/projectstore/remoteprojectstore.cpp b/src/zenremotestore/projectstore/remoteprojectstore.cpp index d26738dde..84841e326 100644 --- a/src/zenremotestore/projectstore/remoteprojectstore.cpp +++ b/src/zenremotestore/projectstore/remoteprojectstore.cpp @@ -2528,8 +2528,7 @@ std::vector<IoHash> GetBlockHashesFromOplog(CbObjectView ContainerObject) { using namespace std::literals; - std::vector<ChunkBlockDescription> Result; - CbArrayView BlocksArray = ContainerObject["blocks"sv].AsArrayView(); + CbArrayView BlocksArray = ContainerObject["blocks"sv].AsArrayView(); std::vector<IoHash> BlockHashes; BlockHashes.reserve(BlocksArray.Num()); @@ -3537,7 +3536,7 @@ SaveOplog(CidStore& ChunkStore, remotestore_impl::ReportMessage( OptionalContext, - fmt::format("Finalize of container '{}' reported {} missing attachments. Uploading missing attachements. Try {}", + fmt::format("Finalize of container '{}' reported {} missing attachments. Uploading missing attachments. Try {}", RemoteStoreInfo.ContainerName, ContainerFinalizeResult.Needs.size(), Try)); @@ -3792,7 +3791,7 @@ ParseOplogContainer( .ElapsedSeconds = Timer.GetElapsedTimeMs() / 1000.0, .Reason = "Operation cancelled"}; } - }; + } remotestore_impl::ReportMessage(OptionalContext, fmt::format("Requesting {} of {} large attachments", NeedAttachmentCount, LargeChunksArray.Num())); @@ -4048,8 +4047,7 @@ LoadOplog(LoadOplogContext&& Context) } else { - // Not a requested block? - ZEN_ASSERT(false); + // Not a requested block? Ignore it } } } @@ -5701,7 +5699,6 @@ RunSaveOplog(CidStore& CidStore, { *OutRemoteStore = RemoteStore; } - RemoteProjectStore::Result Result; SaveOplog(CidStore, *RemoteStore, Project, @@ -6358,7 +6355,7 @@ TEST_CASE("project.store.export.max_data_per_block") std::unique_ptr<ProjectStore> ProjectStoreDummy; Ref<ProjectStore::Project> Project = MakeTestProject(CidStore, Gc, TempDir.Path(), ProjectStoreDummy); - Ref<ProjectStore::Oplog> Oplog = Project->NewOplog("oplog_max_chunks", {}); + Ref<ProjectStore::Oplog> Oplog = Project->NewOplog("oplog_max_data_per_block", {}); REQUIRE(Oplog); // Set up a oid and block size scenario to trigger the various conditions in ComposeBlocks @@ -6404,7 +6401,7 @@ TEST_CASE("project.store.export.max_data_per_block") NetworkPool, WorkerPool, ExportDir.Path(), - "oplog_max_data_per_chunk", + "oplog_max_data_per_block", MaxBlockSize, MaxChunksPerBlock, MaxChunkEmbedSize, @@ -6419,7 +6416,7 @@ TEST_CASE("project.store.export.max_data_per_block") CHECK(KnownBlocks.Blocks.size() >= 2); // Round-trip. - Ref<ProjectStore::Oplog> ImportOplog = Project->NewOplog("oplog_max_data_per_chunk", {}); + Ref<ProjectStore::Oplog> ImportOplog = Project->NewOplog("oplog_max_data_per_block_import", {}); RemoteProjectStore::Result ImportResult = LoadOplog(LoadOplogContext{.ChunkStore = CidStore, .RemoteStore = *RemoteStore, .Oplog = *ImportOplog, diff --git a/src/zenserver/storage/projectstore/httpprojectstore.cpp b/src/zenserver/storage/projectstore/httpprojectstore.cpp index cf4d7d274..8c34e09d7 100644 --- a/src/zenserver/storage/projectstore/httpprojectstore.cpp +++ b/src/zenserver/storage/projectstore/httpprojectstore.cpp @@ -2866,7 +2866,7 @@ HttpProjectService::HandleRpcRequest(HttpRouterRequest& Req) WorkerThreadPool& NetworkWorkerPool = Workers->GetNetworkPool(); Context.ReportMessage(fmt::format("{}", Workers->GetWorkersInfo())); - ; + try { RemoteProjectStore::Result Result = LoadOplog(LoadOplogContext{ |