[Credential Cache Pr 1/3] CachedSupplier ALLOW static stability with uniform backoff #7028
Merged
alextwoods merged 2 commits intoJun 11, 2026
Merged
Conversation
…alidatingError Rewrite CachedSupplier's StaleValueBehavior.ALLOW to implement static stability semantics per the Credential Refresh SEP: - Replace exponential 100ms-10s backoff with uniform random 5-10 minute (300-600 second) backoff on refresh failure - Add CacheInvalidatingError marker interface (utils module) for exceptions that should bypass static stability and propagate immediately - Add CacheInvalidatingException (sdk-core module) as the concrete public exception type implementing CacheInvalidatingError - Handle prefetch-window failures: extend prefetchTime on failure to suppress further attempts until backoff elapses - Update handleFetchedSuccess ALLOW branch for expired-credentials case - Remove consecutiveStaleRetrievalFailures counter (no longer needed) - Deprecate maxStaleFailureJitterTest() (cannot remove due to japicmp) - Add comprehensive tests for static stability, cache-invalidating exception bypass, and backoff range validation
zoewangg
reviewed
Jun 11, 2026
zoewangg
approved these changes
Jun 11, 2026
5a90034
into
feature/master/credential_cache
2 of 3 checks passed
|
This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR merges to feature/master/credential_cache, NOT to master
[Credential Cache Pr 1/3].
Implement updated static stability in CachedSupplier ALLOW mode with uniform backoff + cache invalidation handling.
Motivation and Context
This PR establishes the foundation: rewriting the
CachedSupplierStaleValueBehavior.ALLOWsemantics and introducing theCacheInvalidatingError/CacheInvalidatingExceptiontypes that all subsequent provider changes depend on.PR chain: PR 1 (this) → [PR 2: Provider ALLOW adoption] → [PR 3: Unified timing configuration]
(Note: To view the complete set of changes, see: #7022)
Modifications
CachedSupplierALLOW behavior rewrite (utilsmodule): Replaced the previous exponential 100ms→10s backoff on refresh failure with uniform random 5–10 minute (300-600 second) backoff per the SEP. On failure,handleFetchFailure()now extends bothstaleTimeandprefetchTimeto suppress refresh attempts for the backoff duration. Prefetch-window failures are also handled (previously only stale-window failures were). TheconsecutiveStaleRetrievalFailurescounter andmaxStaleFailureJitter()method are removed (no longer needed with uniform backoff).maxStaleFailureJitterTest()is deprecated (cannot remove due to japicmp).CacheInvalidatingErrormarker interface (utilsmodule): A new@SdkProtectedApimarker interface thatCachedSupplierchecks viainstanceof. When a refresh exception implements this interface, the exception is re-thrown immediately without applying backoff or extending expiration. This enables providers to signal non-recoverable errors (expired SSO tokens, changed passwords) that should bypass static stability.CacheInvalidatingException(sdk-coremodule): A new@SdkPublicApiexception class extendingSdkClientExceptionand implementingCacheInvalidatingError. Providescreate(String)andcreate(String, Throwable)factory methods. Lives insdk-coreto be accessible to all service modules while the marker interface lives inutils(avoiding circular dependencies).Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License