Repository navigation
Fix flaky specs and unsynchronized error collection in multipart upload - #3500
Merged
Merged
Conversation
MultipartFileUploader appended part errors to a shared array from multiple threads without a lock. On JRuby, concurrent part failures could corrupt the array, so upload_file raised NoMethodError instead of MultipartUploadError. Guard the appends with a mutex and add a spec covering simultaneous part failures. Spec fixes: - directory_uploader_spec: synchronize appends in put_object stubs - client_rate_limiter_spec: wait on a signal from the stubbed mutex.sleep instead of a fixed sleep(0.1) - region_spec: read files inside each example rather than holding every file's lines in memory at load time - access_grants_credentials_spec: stub credentials that expire outside the async refresh window, so examples no longer leak refresh threads that broke private_link_spec's signer_for count on MRI - Remove :jruby_flaky tags from the specs that now pass reliably
This comment was marked as outdated.
This comment was marked as outdated.
jnunn-aws
reviewed
Nov 18, 2026
The put_object stub runs on two executor threads. The unsynchronized increment and comparison could skip the value 2, so abort was never called and no DirectoryUploadError was raised.
|
You have made a change to core without a corresponding change to the CHANGELOG.md. This change will not result in a new version and will not published unless an entry is added to CHANGELOG.md. |
jterapin
requested review from
richardwang1124
and removed request for
ashishdhingra and
sichanyoo
November 19, 2026 16:33
jnunn-aws
approved these changes
Nov 20, 2026
jterapin
approved these changes
Nov 20, 2026
jterapin
left a comment
Contributor
There was a problem hiding this comment.
Nice! thank you for fixing this pain point 😄
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.
Fixes one SDK thread-safety bug and four causes of flaky specs. All runs were local on AL2023.
MultipartFileUploader(SDK fix): part errors were appended to an Array from several threads. On JRuby this could raiseNoMethodErrorinstead ofMultipartUploadError. Appends are now under a mutex. JRuby 10.0: 34 of 400 uploads failed before, 0 of 800 after.directory_uploader_spec: stubs appended to an Array from two threads. Now under a mutex. JRuby 10.0: 36 of 400 failed before, 0 of 1,200 after.access_grants_credentials_spec: leaked credential-refresh threads that brokeprivate_link_specon Ruby 4.0 (signer_forreceived 4 times). Stubbed credentials now expire outside the refresh window.region_spec: held 1.1 GB of file text for the whole run, causing GC pauses that timed outdefault_executor_specon Java 8. Files are now read inside each example.client_rate_limiter_spec: replaced a fixedsleep(0.1)with a signal from the waiting thread.:jruby_flakyis removed from the fixed specs. It stays on theClientRateLimiterstress example, which did not fail in 240 runs.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.