diff options
| author | Dan Engelbrecht <[email protected]> | 2025-06-16 13:17:37 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-06-16 13:17:37 +0200 |
| commit | 2dbfa547abd7f9e393cb63f9c70de15d91de2815 (patch) | |
| tree | 722191023ae6eef544b1672562f6c0e4309e1756 | |
| parent | sentry config (#430) (diff) | |
| download | zen-2dbfa547abd7f9e393cb63f9c70de15d91de2815.tar.xz zen-2dbfa547abd7f9e393cb63f9c70de15d91de2815.zip | |
fix build store range check (#437)
* fix range check for blob store fetch
* don't try to parse blockdesriptions if empty result is returned
* add range to log when fetching blob range fails
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | src/zen/cmds/builds_cmd.cpp | 11 | ||||
| -rw-r--r-- | src/zenserver/buildstore/httpbuildstore.cpp | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fb47e756..3b27c5093 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ - `UE_ZEN_SENTRY_ALLOWPERSONALINFO`: `--sentry-allow-personal-info` - `UE_ZEN_SENTRY_DSN`: `--sentry-dsn` - `UE_ZEN_SENTRY_ENVIRONMENT`: `--sentry-environment` +- Bugfix: Range requests for build blobs that reached end of blob now works correctly +- Bugfix: Gracefully handle a malformed response when querying list of blocks + +- ## 5.6.12 - Bugfix: Don't require `--namespace` option when using `zen list-namespaces` command - Bugfix: Crash in upload of blobs to Cloud DDC due to buffer range error diff --git a/src/zen/cmds/builds_cmd.cpp b/src/zen/cmds/builds_cmd.cpp index abb4bfe0c..706fdf9ba 100644 --- a/src/zen/cmds/builds_cmd.cpp +++ b/src/zen/cmds/builds_cmd.cpp @@ -3503,7 +3503,11 @@ namespace { { ZEN_TRACE_CPU("FindBlocks"); Stopwatch KnownBlocksTimer; - Result.KnownBlocks = ParseChunkBlockDescriptionList(Storage.BuildStorage->FindBlocks(BuildId, FindBlockMaxCount)); + CbObject BlockDescriptionList = Storage.BuildStorage->FindBlocks(BuildId, FindBlockMaxCount); + if (BlockDescriptionList) + { + Result.KnownBlocks = ParseChunkBlockDescriptionList(BlockDescriptionList); + } FindBlocksStats.FindBlockTimeMS = KnownBlocksTimer.GetElapsedTimeMs(); FindBlocksStats.FoundBlockCount = Result.KnownBlocks.size(); Result.FindBlocksTimeMs = KnownBlocksTimer.GetElapsedTimeMs(); @@ -7440,7 +7444,10 @@ namespace { } if (!BlockBuffer) { - throw std::runtime_error(fmt::format("Block {} is missing", BlockDescription.BlockHash)); + throw std::runtime_error(fmt::format("Block {} is missing when fetching range {} -> {}", + BlockDescription.BlockHash, + BlockRange.RangeStart, + BlockRange.RangeStart + BlockRange.RangeLength)); } if (!AbortFlag) { diff --git a/src/zenserver/buildstore/httpbuildstore.cpp b/src/zenserver/buildstore/httpbuildstore.cpp index 75a333687..bcec74ce6 100644 --- a/src/zenserver/buildstore/httpbuildstore.cpp +++ b/src/zenserver/buildstore/httpbuildstore.cpp @@ -177,7 +177,7 @@ HttpBuildStoreService::GetBlobRequest(HttpRouterRequest& Req) const uint64_t BlobSize = Blob.GetSize(); const uint64_t MaxBlobSize = Range.Start < BlobSize ? Range.Start - BlobSize : 0; const uint64_t RangeSize = Min(Range.End - Range.Start + 1, MaxBlobSize); - if (Range.Start + RangeSize >= BlobSize) + if (Range.Start + RangeSize > BlobSize) { return ServerRequest.WriteResponse(HttpResponseCode::NoContent); } |