Conversation
…hods The five TransferManager transfer methods build their executor as `@executor || DefaultExecutor.new(max_threads: opts.delete(:thread_count))`. Ruby's `||` short-circuits, so when a custom executor was given to the constructor the `delete` never runs and `:thread_count` stays in the options hash. On `upload_file` it reaches the unfiltered `put_object` call on the single-part path and raises `ArgumentError: unexpected value at params[:thread_count]`, while the multipart path filters the key out, so the same call fails or succeeds depending on file size. Hoist the `delete` above the `||` so the key is always removed. Behavior is now uniform: `:thread_count` is honored when no custom executor was provided and ignored when one was, matching the existing docstrings. Separately, `Object#download_file` deleted `[:thread_count]`, an Array that never matches the Symbol, so it always used the default thread count.
jterapin
marked this pull request as ready for review
September 24, 2026 17:31
Base automatically changed from
fix/gh-3419-transfer-manager-executor-shutdown
to
version-3
September 24, 2026 19:52
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
Targeted at #3427 branch, so the diff here shows only this change.
Will retarget to
version-3once #3427 merges.Description
Every
TransferManagerdocumentation states that:thread_countis "Only used when no custom executor when provided" but the current implementation does not honor that:upload_fileraisesArgumentErrorwhen:thread_countand a customexecutor:are combined, because||short-circuits past thedelete. The other four ignore the option.Object#download_filehas never honored:thread_count; it deletes an Array key that never matches.Fix
Hoist the
deleteabove the||at all fiveTransferManagersites, and delete the Symbol rather than the Array incustomizations/object.rb:Testing
Full
gems/aws-sdk-s3suite: 1678 examples, 0 failures, 3 pending (1665 before).🤖 AI-assisted and manually reviewed by @jterapin ✨