-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors downloading files from s3 are propagated to incorrect thread #2946
Comments
Thanks for reporting this, we will be taking a look. |
Hi! Which version are you using for the |
|
Yep, still an issue. |
Is removing |
Ahh that's a good point - simply removing |
|
Thank you for your patience! The fix has been merged into main but a new version of S3 gem will not be released until around Dec 4 (due to reInvent). Apologizes for the inconvenience. |
Describe the bug
While downloading files from S3, any exceptions are propagated to the main thread instead of the calling thread.
This appears to be due to the use of
Thread.abort_on_exception
(seeaws-sdk-ruby/gems/aws-sdk-s3/lib/aws-sdk-s3/file_downloader.rb
Line 193 in e0115af
Expected Behavior
Exceptions propagate to the calling context
Current Behavior
Exceptions are propagated to the main thread, interrupting unrelated code.
Reproduction Steps
Because the error is propagated to the main thread instead of the calling thread, and the main thread has no exception handler, the process aborts unexpectedly.
Possible Solution
Instead of using
abort_on_exception
, store the calling thread at the start ofdownload_in_threads
and usecalling_thread.raise(exception)
to propagate errors.Additional Information/Context
No response
Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version
aws-sdk-s3
Environment details (Version of Ruby, OS environment)
3.2.2 / linux
The text was updated successfully, but these errors were encountered: