-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: ThreadId miss unlock(#1107) #1108
Conversation
WalkthroughThe changes address potential deadlock issues in the Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- jraft-core/src/main/java/com/alipay/sofa/jraft/util/ThreadId.java (1 hunks)
- jraft-core/src/test/java/com/alipay/sofa/jraft/util/ThreadIdTest.java (1 hunks)
Files skipped from review due to trivial changes (1)
- jraft-core/src/main/java/com/alipay/sofa/jraft/util/ThreadId.java
Additional comments not posted (1)
jraft-core/src/test/java/com/alipay/sofa/jraft/util/ThreadIdTest.java (1)
62-62
: Adjustment of the delta value in the assertion.Please add a comment explaining the reason for changing the delta from 10 to 20. This helps maintain clarity for future maintainers regarding the expected behavior and any observed flakiness or timing changes in the test environment.
@killme2008 Please take a look, and I wonder if we can just use |
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.
LGTM
Motivation:
在 ThreadId lock 和 destroy ThreadId 并发情况下,可能导致 ThreadId 锁不释放
Modification:
取消判断 ThreadId 是否 destroy 来释放锁,而是只要持有就释放。因为在 onError 中可能释放锁,需要判断
isHeldByCurrentThread()
是否持有来释放锁Result:
Fixes #1107
Summary by CodeRabbit
Bug Fixes
Tests