-
Notifications
You must be signed in to change notification settings - Fork 869
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 reload credentials not working when modified - external PR : #5185 #5259
Closed
Closed
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
91c6a1f
Creating a pr from a branch for external PR 5185; as it cannot load c…
anirudh9391 94d8401
Fixed indendation
anirudh9391 9295eb7
Fix indendation
anirudh9391 9327518
Initializing with aggregator
anirudh9391 776aa6b
Fixed indendation
anirudh9391 ba3c6b5
Merge branch 'master' into anirudkr/reload-credential-fix-muendrasan
anirudh9391 9ab0b47
Refactor ProfileSupplier instantiation
anirudh9391 7ca7075
initialized profile supplier to null
anirudh9391 6681fab
Merge branch 'master' into anirudkr/reload-credential-fix-muendrasan
anirudh9391 87bd23b
Merge branch 'master' into anirudkr/reload-credential-fix-muendrasan
anirudh9391 032a2e5
Increasing timeout value
anirudh9391 536548c
increased thread sleep duration
anirudh9391 a469d8a
Added retry
anirudh9391 badc28c
Merge branch 'master' into anirudkr/reload-credential-fix-muendrasan
anirudh9391 2b330db
Merge branch 'master' into anirudkr/reload-credential-fix-muendrasan
L-Applin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anirudh9391 For Java8, the test is failing pos this, had included delay to ensure latest config is picked up, but it is failing occasionally,
Should we increase the sleep value? Is there any alternative way to validate this?
For Java17, the test failures seems to be unrelated & from s3 module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Java17 error seems to be transient in nature. It seems to succeed locally. I will play around with timeout values a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to the caching of ProfileFile for short duration,
aws-sdk-java-v2/utils/src/main/java/software/amazon/awssdk/utils/cache/CachedSupplier.java
Line 242 in fb7b6ea
the credentials are not reloaded immediately, hence, Thread.sleep is required, added 2s sleep which in most cases sufficient, is not working in CI sometimes.
Here, sleep duration can be increased or assertion can retried with smaller timeout values
For reference, in ProfileRefresherTest
aws-sdk-java-v2/core/profiles/src/test/java/software/amazon/awssdk/profiles/internal/ProfileFileRefresherTest.java
Line 134 in fb7b6ea
Custom clock is used to advance the timer to validate refresh without sleep which might not be possible here, ie to set custom clock in ProfileSupplier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it with a 5 second delay. Seems to trip up the java21 and java8 builds, both of which fail assertion. Please feel free to cut another revision with any modifications to add retries or anything else. I think we can keep timeout at 5 seconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed another revision with a retry. Lets see if this works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the retry failed all the java builds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @anirudh9391 , will take a look. Going through the commit, I think retry should be added to second assertion, once credentials are modified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the retry logic, along with additional logging to debug the test, if it fails again in the commits e360e9d and f330457 respectively
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anirudh9391 could you please cherry-pick latest commit for the fix, and further debugging?