aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-04-24 15:45:34 +0200
committerGitHub Enterprise <[email protected]>2025-04-24 15:45:34 +0200
commit0a3d04458199a1bfe2c60fc7ce174dbea20713a6 (patch)
treee70d917f335cd8382235005b3b76831df1b29a6f
parentuse state file if available when doing builds diff command (#369) (diff)
downloadzen-0a3d04458199a1bfe2c60fc7ce174dbea20713a6.tar.xz
zen-0a3d04458199a1bfe2c60fc7ce174dbea20713a6.zip
limit retries on buildpart finalize (#374)
* limit retries on buildpart finalize
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zen/cmds/builds_cmd.cpp10
2 files changed, 9 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2ee70db01..be9e465de 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
- Bugfix: Use proper FindClose call when using fallback when getting file attributes on windows
- Bugfix: Fixed race condition at final chunks when downloading multipart blobs which could lead to corruption and/or crash
- Bugfix: Fixed BigInt conversion error affecting the tree view in the web UI
+- Bugfix: Limit retry count when finalizing build part to avoid getting stuck in an infinite loop
- Bugfix: Fixed lua config naming for zenserver `--buildstore-disksizelimit` option
- Feature: New `zen wipe` command for fast cleaning of directories, it will not remove the directory itself, only the content
- `--directory` - path to directory to wipe, if the directory does not exist or is empty, no action will be taken
diff --git a/src/zen/cmds/builds_cmd.cpp b/src/zen/cmds/builds_cmd.cpp
index 855d7012f..f50f6205b 100644
--- a/src/zen/cmds/builds_cmd.cpp
+++ b/src/zen/cmds/builds_cmd.cpp
@@ -2475,7 +2475,7 @@ namespace {
BlockIndexes.push_back(It->second);
TotalBlocksSize += NewBlocks.BlockSizes[It->second];
}
- if (auto ChunkIndexIt = Lookup.ChunkHashToChunkIndex.find(RawHash); ChunkIndexIt != Lookup.ChunkHashToChunkIndex.end())
+ else if (auto ChunkIndexIt = Lookup.ChunkHashToChunkIndex.find(RawHash); ChunkIndexIt != Lookup.ChunkHashToChunkIndex.end())
{
const uint32_t ChunkIndex = ChunkIndexIt->second;
if (auto LooseOrderIndexIt = ChunkIndexToLooseChunkOrderIndex.find(ChunkIndex);
@@ -2485,6 +2485,11 @@ namespace {
TotalLooseChunksSize += Content.ChunkedContent.ChunkRawSizes[ChunkIndex];
}
}
+ else
+ {
+ throw std::runtime_error(
+ fmt::format("Can not upload requested build blob {} as it was not generated by this upload", RawHash));
+ }
}
uint64_t TotalRawSize = TotalLooseChunksSize + TotalBlocksSize;
@@ -3644,7 +3649,8 @@ namespace {
UploadAttachments(PutBuildPartResult.second);
}
- while (!AbortFlag)
+ uint32_t FinalizeBuildPartRetryCount = 5;
+ while (!AbortFlag && (FinalizeBuildPartRetryCount--) > 0)
{
Stopwatch FinalizeBuildPartTimer;
std::vector<IoHash> Needs = Storage.BuildStorage->FinalizeBuildPart(BuildId, BuildPartId, PartHash);