Fix/background identity interrupt - #697
Open
alex268 wants to merge 2 commits into
Open
Conversation
BackgroundIdentity.unwrap returned null after an InterruptedException. SyncLogin.validate feeds that value straight into updateState, which CAS-ed the shared state reference to null and then threw a NullPointerException from next.init(). The reference stayed null, so every following getToken() call - on any thread - failed with a NullPointerException and authentication for the whole transport was permanently dead after a single interrupt. Throw instead of returning null, keeping the interrupt flag set. The state stays in SyncLogin, so the next getToken() re-checks the same login future and recovers on its own. updateState now also rejects a null state explicitly, so a future regression fails loudly at the call site. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
AI Review Summary
Verdict: ✅ No critical issues found
Critical issues
No critical issues found.
Other findings
- Minor | Low:
StaticCredentials.tryLogin()replaces try-with-resources with manualtransport.close()in awhenCompletecallback, losing the safety net if a synchronous exception occurs betweenrpc.createTransport()and callback registration —core/src/main/java/tech/ydb/core/auth/StaticCredentials.java:120
This review was generated automatically. Critical issues require attention; other findings are advisory.
If this comment was useful, please give it a 👍 — it helps us improve the review bot.
|
Analysis performed by claude, claude-opus-4-6. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #697 +/- ##
============================================
+ Coverage 71.91% 72.00% +0.09%
- Complexity 3474 3493 +19
============================================
Files 390 391 +1
Lines 16220 16277 +57
Branches 1698 1706 +8
============================================
+ Hits 11664 11720 +56
Misses 3904 3904
- Partials 652 653 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
No description provided.