Pre-zip xplat dump payloads to bypass Helix SDK 2 GB MemoryStream cap#127871
Open
max-charlamb wants to merge 1 commit intodotnet:mainfrom
Open
Pre-zip xplat dump payloads to bypass Helix SDK 2 GB MemoryStream cap#127871max-charlamb wants to merge 1 commit intodotnet:mainfrom
max-charlamb wants to merge 1 commit intodotnet:mainfrom
Conversation
The Helix SDK's <PayloadDirectory> code path (DirectoryPayload.UploadAsync)
zips the directory into a MemoryStream before upload. MemoryStream's backing
array is capped at int.MaxValue (~2 GiB), so per-platform dump payloads that
approach that size fail in CdacXPlatDumpTest with:
System.IO.IOException: Stream was too long.
at System.IO.MemoryStream.set_Capacity(Int32 value)
Switch the cDAC xplat dump tests to pre-zip each per-platform dump directory
with the MSBuild ZipDirectory task and ship the resulting .zip via
<PayloadArchive>. ArchivePayload uses File.OpenRead and streams directly to
blob storage, with no in-memory buffering. CompressionLevel=Fastest keeps
the local zip step cheap; dumps don't compress meaningfully anyway.
This follows the same pattern already used in
src/tests/Common/helixpublishwitharcade.proj.
Fixes dotnet#127859
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the cDAC x-plat dump Helix submission project to avoid intermittent Helix SDK failures caused by the SDK’s <PayloadDirectory> path building a ZIP in a MemoryStream (which is capped at ~2 GiB). It pre-creates per-platform ZIPs on disk and ships them via <PayloadArchive> so upload can stream from a FileStream.
Changes:
- Pre-zip each per-platform dump directory using MSBuild’s
ZipDirectorytask. - Switch Helix work items from
<PayloadDirectory>to<PayloadArchive>pointing at the prebuilt ZIP. - Update inline documentation to explain the rationale and the 2 GiB cap being avoided.
steveisok
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR was authored with assistance from GitHub Copilot.
Problem
"" + CdacXPlatDumpTest + "" + Helix work items fail intermittently with:
System.IO.IOException: Stream was too long.
at System.IO.MemoryStream.set_Capacity(Int32 value)
The Helix SDK's
<PayloadDirectory>code path (DirectoryPayload.UploadAsync) zips the source directory into aMemoryStreambefore uploading.MemoryStream's backing array is capped atint.MaxValue(~2 GiB), so per-platform dump payloads that approach that size fail.Fixes #127859.
Fix
Pre-zip each per-platform dump directory with MSBuild's built-in
ZipDirectorytask and ship the resulting.zipvia<PayloadArchive>instead of<PayloadDirectory>.ZipDirectorycallsZipFile.CreateFromDirectory, which writes the archive directly to aFileStream-- no 2 GiB cap.ArchivePayload(selected by<PayloadArchive>) usesFile.OpenReadand streams the existing zip to blob storage without any in-memory buffering.CompressionLevel="Fastest"keeps the local zip step cheap; dump files don't compress meaningfully anyway.This is the same pattern already used in
src/tests/Common/helixpublishwitharcade.proj.Validation
ZipDirectory+ target-batching pattern against fake per-platform directories: produces one.zipper platform as expected withOverwrite="true".runtime-diagnosticswithcdacDumpTestMode=xplatagainst this PR.