Repository navigation
Conversation
Nx uploads each task's output as one PUT. The server read the whole body into memory, copied it into a second buffer and only then sent a single PutObject, so memory grew with artifact size times concurrent uploads, and a few large outputs in parallel could take the server down mid-run. The body now goes to S3 as it arrives. Up to 8 MiB it is one PutObject; anything larger is a multipart upload of 8 MiB parts, aborted if a part or the client fails. Parts are in-memory buffers, so the SDK can still retry them. StorageProvider::store keeps its signature. If storage fails part-way, the rest of the body is drained before the answer, as for the other refusals (nxcite#22). Nx sees the same statuses as before: 200 stored, 409 present, 400 for an upload cut short, 500 for a storage failure. Operators see memory bounded at about one part per upload, and need s3:AbortMultipartUpload for the cleanup; the README recommends a lifecycle rule for uploads the server could not abort. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 27, 2026
This branch has not been deployed
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.
Replaces #11, which streamed each upload as one sized
PutObject. That design cost the SDK its retries, still buffered uploads without aContent-Length, and had to switch off request checksums on custom endpoints. This one keeps theStorageProvider::storesignature and is what we have run in production since July.Problem
store_artifactread the whole PUT body into memory, andS3Storage::storecopied it into a second buffer before a singlePutObject. Peak memory is about twice the artifact size per concurrent upload, so a few large task outputs in parallel can take the server down mid-run, and Nx then fails those tasks.What changes
PutObject. Anything larger is a multipart upload of 8 MiB parts (S3's minimum is 5 MiB), so an upload holds at most one part in memory.PutObject.store, so it gets its ownStorageError::ClientAbort; without ite2e/aborted-upload.test.tswould get 500.s3:AbortMultipartUploadis needed next tos3:PutObject, and gives the lifecycle rule that removes uploads the server could not abort (it was killed mid-upload, or the abort failed).What a user sees
Nx sees the same statuses as before: 200 stored, 409 present, 400 for an upload cut short, 500 for a storage failure. Operators see bounded memory, and need
s3:AbortMultipartUploadfor the cleanup.Peak RSS of the server across one PUT, debug build, SeaweedFS:
masterTests
Two cases in
e2e/round-trip.test.ts: an artifact of exactly one part, and one spanning three parts, both returned byte for byte. Nothing in the suite sent more than one part to S3 before. Both also pass onmaster, because buffering works for any size: they guard the multipart path rather than show the fix. The memory bound has no test; the numbers above are measured by hand.cargo fmt --check,cargo clippy --all-targets -- -D warnings, format, lint, typecheck,test:offline(24/24) andtest:e2e(21/21) are green.🤖 Generated with Claude Code