You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "3pacccccc (via GitHub)" <gi...@apache.org> on 2025/10/22 08:59:46 UTC
[PR] [fix][broker] Fix totalAvailablePermits not reduced when removing consumer from non-persistent dispatcher [pulsar]
3pacccccc opened a new pull request, #24885:
URL: https://github.com/apache/pulsar/pull/24885
### 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
- [x] Make sure that the change passes the CI checks.
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*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
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: https://github.com/3pacccccc/pulsar/pull/28
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][broker] Fix totalAvailablePermits not reduced when removing consumer from non-persistent dispatcher [pulsar]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #24885:
URL: https://github.com/apache/pulsar/pull/24885#issuecomment-3449319751
## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/24885?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 38.48%. Comparing base ([`8828734`](https://app.codecov.io/gh/apache/pulsar/commit/88287345d3246fe0d6ea34e06389356ada516cfa?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`29d8140`](https://app.codecov.io/gh/apache/pulsar/commit/29d81400097ff0bcffbcb496c52d02cc9027260b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on master.
> :exclamation: There is a different number of reports uploaded between BASE (8828734) and HEAD (29d8140). Click for more details.
>
> <details><summary>HEAD has 11 uploads less than BASE</summary>
>
>| Flag | BASE (8828734) | HEAD (29d8140) |
>|------|------|------|
>|unittests|6|2|
>|inttests|4|1|
>|systests|5|1|
></details>
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/pulsar/pull/24885?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #24885 +/- ##
=============================================
- Coverage 74.38% 38.48% -35.90%
+ Complexity 33513 100 -33413
=============================================
Files 1913 1856 -57
Lines 149317 145334 -3983
Branches 17331 16905 -426
=============================================
- Hits 111064 55932 -55132
- Misses 29422 81832 +52410
+ Partials 8831 7570 -1261
```
| [Flag](https://app.codecov.io/gh/apache/pulsar/pull/24885/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [inttests](https://app.codecov.io/gh/apache/pulsar/pull/24885/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.43% <0.00%> (-0.38%)` | :arrow_down: |
| [systests](https://app.codecov.io/gh/apache/pulsar/pull/24885/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `22.78% <0.00%> (-0.23%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pulsar/pull/24885/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `34.70% <100.00%> (-39.20%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Files with missing lines](https://app.codecov.io/gh/apache/pulsar/pull/24885?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...tent/NonPersistentDispatcherMultipleConsumers.java](https://app.codecov.io/gh/apache/pulsar/pull/24885?src=pr&el=tree&filepath=pulsar-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fbroker%2Fservice%2Fnonpersistent%2FNonPersistentDispatcherMultipleConsumers.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL25vbnBlcnNpc3RlbnQvTm9uUGVyc2lzdGVudERpc3BhdGNoZXJNdWx0aXBsZUNvbnN1bWVycy5qYXZh) | `63.09% <100.00%> (-4.38%)` | :arrow_down: |
... and [1415 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/24885/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][broker] Fix totalAvailablePermits not reduced when removing consumer from non-persistent dispatcher [pulsar]
Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- commented on PR #24885:
URL: https://github.com/apache/pulsar/pull/24885#issuecomment-3449383560
/pulsarbot rerun-failure-checks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][broker] Fix totalAvailablePermits not reduced when removing consumer from non-persistent dispatcher [pulsar]
Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- merged PR #24885:
URL: https://github.com/apache/pulsar/pull/24885
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][broker] Fix totalAvailablePermits not reduced when removing consumer from non-persistent dispatcher [pulsar]
Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- commented on PR #24885:
URL: https://github.com/apache/pulsar/pull/24885#issuecomment-3448439162
/pulsarbot rerun-failure-checks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][broker] Fix totalAvailablePermits not reduced when removing consumer from non-persistent dispatcher [pulsar]
Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- closed pull request #24885: [fix][broker] Fix totalAvailablePermits not reduced when removing consumer from non-persistent dispatcher
URL: https://github.com/apache/pulsar/pull/24885
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org