Skip to content
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

Fix race condition in S3 Express identity cache #1073

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

jakob-keller
Copy link
Collaborator

@jakob-keller jakob-keller commented Jan 16, 2024

Description of Change

A race condition in the S3 Express identity cache was introduced in 110b0a2. This change modifies the cache to hold asyncio.Task instances instead of actual credentials to mitigate the issue without introducing locking.

Assumptions

Replace this text with any assumptions made (if any)

Checklist for All Submissions

  • I have added change info to CHANGES.rst
  • If this is resolving an issue (needed so future developers can determine if change is still necessary and under what conditions) (can be provided via link to issue with these details): closes S3 Express Session opened for all asyncio calls #1072
    • Detailed description of issue
    • Alternative methods considered (if any): This race condition might also be resolved through locking. This would result in additional complexity and runtime overhead.
    • How issue is being resolved: The cache holds asyncio.Task instances that wrap the underlying get_credentials coroutine.
    • How issue can be reproduced
  • If this is providing a new feature (can be provided via link to issue with these details):
    • Detailed description of new feature
    • Why needed
    • Alternatives methods considered (if any)

Checklist when updating botocore and/or aiohttp versions

  • I have read and followed CONTRIBUTING.rst
  • I have updated test_patches.py where/if appropriate (also check if no changes necessary)
  • I have ensured that the awscli/boto3 versions match the updated botocore version

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (110b0a2) 86.13% compared to head (9097884) 86.25%.

Files Patch % Lines
aiobotocore/utils.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1073      +/-   ##
==========================================
+ Coverage   86.13%   86.25%   +0.12%     
==========================================
  Files          60       60              
  Lines        5863     5858       -5     
==========================================
+ Hits         5050     5053       +3     
+ Misses        813      805       -8     
Flag Coverage Δ
unittests 86.25% <50.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jakob-keller jakob-keller marked this pull request as ready for review January 16, 2024 19:33
@jakob-keller jakob-keller changed the title fix race condition in S3 Express identity cache (closes #1072) Fix race condition in S3 Express identity cache Jan 16, 2024
@jakob-keller
Copy link
Collaborator Author

@thehesiod: I'm looking forward to your review.

@thehesiod thehesiod mentioned this pull request Jan 17, 2024
@thehesiod
Copy link
Collaborator

mind just bumping the release date then I'll merge and deploy. Thanks! very nice implementation

@thehesiod thehesiod merged commit 7ea5c2f into aio-libs:master Jan 17, 2024
10 of 11 checks passed
@jakob-keller jakob-keller deleted the fix-credential-cache branch January 17, 2024 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

S3 Express Session opened for all asyncio calls
2 participants