Repository navigation
Conversation
Keep the item used by an active lookup when another secret evicts its cache mapping. Reuse a competing same-key item while it remains cached, without changing the public LRU API, capacity, or TTL. Cover all three entry points with deterministic concurrent eviction and same-key insertion regressions. Assisted-by: Codex/GPT-6
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.
Description
Why is this change being made?
With a one-entry cache, inserting another secret between
putIfAbsentand the subsequent lookup can evict the requested item. The lookup then returns null, causinggetSecretString,getSecretBinary, orrefreshNowto throwNullPointerException.What is changing?
Retain the newly created item for the in-flight request. Reuse a competing same-key item while it remains cached. The public LRU API, capacity, and TTL are unchanged; evicted items are not reinserted.
AI-assisted implementation and tests using Codex/GPT-6; the author reviewed the diff.
Related Links
Testing
How was this tested?
When testing locally, provide testing artifact(s):
mvn -B clean packageon macOS, Temurin 21 / Java release 8:Checkstyle and SpotBugs passed. AWS SDK calls were mocked; native Linux CI has not run locally.
Reviewee Checklist
If not, why: JaCoCo report generated locally; remote coverage pending.
If not, why: No public behavior or configuration documentation changes needed.
If not, why: No public API changes.
Reviewer Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.