Repository navigation
Fix race when publishing refreshed credentials - #3835
Merged
Merged
Conversation
kuhe
approved these changes
Oct 19, 2026
This was referenced Oct 19, 2026
Alan4506
pushed a commit
that referenced
this pull request
Oct 19, 2026
* release-1.43.115: Bumping version to 1.43.115 Update to latest models Fix race when publishing refreshed credentials (#3835) Bump urllib3 from 2.7.0 to 2.8.0 (#3813) Move Content-Length validation back to botocore (#3831) Add W3C headers to unsigned hop-by-hop header list (#3805) Bump https://github.com/astral-sh/ruff-pre-commit (#3829)
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 #, if available:
Fixes #3827
Overview
Fixes a race where a concurrent call to
get_frozen_credentials()could return expired credentials while another thread was refreshing them.The refreshed expiry time could become visible before the refreshed frozen credentials were published. A concurrent caller could then see the new expiry time and return the old credentials.
Approach
This change stages the refreshed expiry time until the credentials are ready to be published. The frozen credentials are published first, followed by the new expiry time.
Publication remains in
_protected_refresh()instead of moving into_set_from_data(). This preserves existing behavior for custom credential providers that override_set_from_data()as part of their refresh implementation.Testing
Added a concurrency test verifying that callers receive the refreshed frozen credentials during a refresh. Existing credential tests continue to pass.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.