Skip to content

Conversation

@nodece
Copy link
Member

@nodece nodece commented Aug 19, 2025

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

  • Added a double-check inside the existing synchronized block for non-durable cursor creation.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
@nodece
Copy link
Member Author

nodece commented Aug 20, 2025

/pulsarbot rerun-failure-checks

@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.26%. Comparing base (34f8657) to head (fa50bd4).
⚠️ Report is 211 commits behind head on master.

Files with missing lines Patch % Lines
...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java 66.66% 2 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
inttests 26.76% <33.33%> (-0.03%) ⬇️
systests 23.28% <33.33%> (-0.16%) ⬇️
unittests 73.74% <66.66%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java 81.08% <66.66%> (-0.11%) ⬇️

... and 82 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@dao-jun dao-jun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nodece nodece merged commit e642e17 into apache:master Aug 20, 2025
72 of 75 checks passed
@nodece nodece added this to the 4.1.0 milestone Aug 20, 2025
@nodece nodece deleted the add-double-check-for-non-durable-cursor branch August 20, 2025 13:57
lhotari pushed a commit that referenced this pull request Aug 26, 2025
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit e642e17)
lhotari pushed a commit that referenced this pull request Aug 26, 2025
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit e642e17)
lhotari pushed a commit that referenced this pull request Aug 26, 2025
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit e642e17)
nodece added a commit to ascentstream/pulsar that referenced this pull request Aug 26, 2025
…e#24643)

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit e642e17)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Aug 28, 2025
…e#24643)

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit e642e17)
(cherry picked from commit fd2b109)
ganesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Aug 29, 2025
…e#24643)

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit e642e17)
(cherry picked from commit c59f406)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Sep 3, 2025
…e#24643)

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit e642e17)
(cherry picked from commit c59f406)
Technoboy- pushed a commit to Technoboy-/pulsar that referenced this pull request Sep 10, 2025
…e#24643)

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit e642e17)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Sep 12, 2025
…e#24643)

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit e642e17)
(cherry picked from commit fd2b109)
KannarFr pushed a commit to CleverCloud/pulsar that referenced this pull request Sep 22, 2025
walkinggo pushed a commit to walkinggo/pulsar that referenced this pull request Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants