fix(lib-storage): reject done() with TimeoutError when CompleteMultipartUpload hangs - #8073
Open
Zelys-DFKH wants to merge 1 commit into
Open
fix(lib-storage): reject done() with TimeoutError when CompleteMultipartUpload hangs#8073Zelys-DFKH wants to merge 1 commit into
Zelys-DFKH wants to merge 1 commit into
Conversation
…artUpload hangs Add `completeMultipartUploadTimeout` option to Upload. When set, a dropped TCP connection during the CompleteMultipartUpload call (common when assembling large objects on S3's side takes > 15 min and a transparent proxy kills the idle socket) now rejects the done() promise with a TimeoutError instead of hanging forever. The option defaults to undefined, preserving existing behavior for callers who don't set it. Fixes aws#7729 This change was generated with AI assistance and reviewed by me.
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.
Issue
#7729
Description
Upload.done()hangs forever when the TCP connection carrying theCompleteMultipartUploadresponse is silently dropped by a network intermediary (firewall, DLP appliance, transparent proxy) while S3 assembles a large object server-side. This is common on uploads over ~15 minutes: all parts upload successfully, the complete call goes out, but the HTTP response never arrives because the proxy killed the idle connection. With no timeout on thatclient.send()call, the promise stalls indefinitely.This adds a
completeMultipartUploadTimeoutoption (milliseconds) toUpload. When set, theCompleteMultipartUploadsend races against asetTimeout; if the timer fires first,done()rejects with aTimeoutError. Without the option, behavior is identical to before: no timeout imposed.The workaround from #7729 (configure
keepAlive: trueon the HTTP agent) still works. This option is complementary for callers who can't control the network layer or who want a hard deadline.Credit: @paffoobar's root-cause analysis in #7729.
This change was generated with AI assistance and reviewed by me.
Testing
Added two unit tests to
Upload.spec.ts(54/54 passing):CompleteMultipartUploadhangs indefinitely: rejects withTimeoutErrorafter the configured millisecondsCompleteMultipartUploadtakes (backward-compatible path verified)Checklist