Skip to content

Conversation

@3pacccccc
Copy link
Contributor

Motivation

When NonPersistentDispatcherMultipleConsumers removes a consumer via the removeConsumer() method, the TOTAL_AVAILABLE_PERMITS_UPDATER is not properly decremented when there are multiple consumers (consumers' size > 1). This creates an inconsistency where the dispatcher maintains an inflated count of available permits after consumer removal

Modifications

  • Added logic in NonPersistentDispatcherMultipleConsumers.removeConsumer() to properly decrement TOTAL_AVAILABLE_PERMITS_UPDATER by the removed consumer's available permits when consumers' size > 1

  • Added test case testTotalAvailablePermitsWhenRemoveConsumer() to verify:

    • Initial permit counting works correctly

    • Permit reduction happens properly when removing consumers

Verifying this change

  • Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

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

Matching PR in forked repository

PR in forked repository: 3pacccccc#28

@Technoboy-
Copy link
Contributor

/pulsarbot rerun-failure-checks

@Technoboy- Technoboy- closed this Oct 27, 2025
@Technoboy- Technoboy- reopened this Oct 27, 2025
@codecov-commenter
Copy link

codecov-commenter commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.60%. Comparing base (8828734) to head (29d8140).
⚠️ Report is 2 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (8828734) and HEAD (29d8140). Click for more details.

HEAD has 9 uploads less than BASE
Flag BASE (8828734) HEAD (29d8140)
unittests 6 2
inttests 4 2
systests 5 2
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #24885       +/-   ##
=============================================
- Coverage     74.38%   38.60%   -35.78%     
+ Complexity    33513      100    -33413     
=============================================
  Files          1913     1856       -57     
  Lines        149317   145334     -3983     
  Branches      17331    16905      -426     
=============================================
- Hits         111064    56101    -54963     
- Misses        29422    81647    +52225     
+ Partials       8831     7586     -1245     
Flag Coverage Δ
inttests 26.52% <0.00%> (-0.29%) ⬇️
systests 22.82% <0.00%> (-0.19%) ⬇️
unittests 34.70% <100.00%> (-39.20%) ⬇️

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

Files with missing lines Coverage Δ
...tent/NonPersistentDispatcherMultipleConsumers.java 63.09% <100.00%> (-4.38%) ⬇️

... and 1414 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.

@Technoboy-
Copy link
Contributor

/pulsarbot rerun-failure-checks

@Technoboy- Technoboy- merged commit ebfff58 into apache:master Oct 28, 2025
418 of 435 checks passed
lhotari pushed a commit that referenced this pull request Oct 28, 2025
…sumer from non-persistent dispatcher (#24885)

(cherry picked from commit ebfff58)
lhotari pushed a commit that referenced this pull request Oct 28, 2025
…sumer from non-persistent dispatcher (#24885)

(cherry picked from commit ebfff58)
lhotari pushed a commit that referenced this pull request Oct 28, 2025
…sumer from non-persistent dispatcher (#24885)

(cherry picked from commit ebfff58)
lhotari pushed a commit that referenced this pull request Oct 28, 2025
…sumer from non-persistent dispatcher (#24885)

(cherry picked from commit ebfff58)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Oct 29, 2025
…sumer from non-persistent dispatcher (apache#24885)

(cherry picked from commit ebfff58)
(cherry picked from commit 8b3245f)
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Oct 29, 2025
…sumer from non-persistent dispatcher (apache#24885)

(cherry picked from commit ebfff58)
(cherry picked from commit 048df0d)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Oct 30, 2025
…sumer from non-persistent dispatcher (apache#24885)

(cherry picked from commit ebfff58)
(cherry picked from commit 048df0d)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Oct 30, 2025
…sumer from non-persistent dispatcher (apache#24885)

(cherry picked from commit ebfff58)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 6, 2025
…sumer from non-persistent dispatcher (apache#24885)

(cherry picked from commit ebfff58)
(cherry picked from commit 8b3245f)
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.

5 participants