-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Add double-check for non-durable cursor creation #24643
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][broker] Add double-check for non-durable cursor creation #24643
Conversation
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
|
/pulsarbot rerun-failure-checks |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #24643 +/- ##
============================================
- Coverage 74.32% 74.26% -0.07%
+ Complexity 33180 33155 -25
============================================
Files 1882 1882
Lines 146855 146862 +7
Branches 16867 16869 +2
============================================
- Hits 109152 109063 -89
- Misses 29038 29124 +86
- Partials 8665 8675 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
dao-jun
left a comment
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
Signed-off-by: Zixuan Liu <nodeces@gmail.com> (cherry picked from commit e642e17)
Signed-off-by: Zixuan Liu <nodeces@gmail.com> (cherry picked from commit e642e17)
Signed-off-by: Zixuan Liu <nodeces@gmail.com> (cherry picked from commit e642e17)
…e#24643) Signed-off-by: Zixuan Liu <nodeces@gmail.com>
…e#24643) Signed-off-by: Zixuan Liu <nodeces@gmail.com>
Motivation
In race conditions, multiple threads could attempt to create the same non-durable cursor simultaneously.
Adding a double-check ensures that if a cursor is already created by another thread while waiting in the synchronized block, the existing cursor is returned instead of creating a new one. This preserves thread safety and avoids duplicate cursor creation.
Modifications
Documentation
docdoc-requireddoc-not-neededdoc-complete