You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2025/11/21 15:00:24 UTC
[PR] [fix][client] Fix double recycling of the message in isValidConsumerEpoch method [pulsar]
lhotari opened a new pull request, #25008:
URL: https://github.com/apache/pulsar/pull/25008
### Motivation
There's a bug in the isValidConsumerEpoch method:
https://github.com/apache/pulsar/blob/807dcaf5d928f8202c1bf8b8402cfcf72a41e63d/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java#L1307-L1319
There's a call to both `message.release()` and `message.recycle()`.
`message.release()` will call `recycle()` when it's a pooled message:
https://github.com/apache/pulsar/blob/807dcaf5d928f8202c1bf8b8402cfcf72a41e63d/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java#L738-L744
This is why it's a problem if both `release()` and `recycle()` are called.
### Modifications
Remove the `message.recycle()` call.
### 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 -->
--
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][client] Fix double recycling of the message in isValidConsumerEpoch method [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #25008:
URL: https://github.com/apache/pulsar/pull/25008#issuecomment-3570584991
> Is it possible to add a test? This issue should always happen when polled message is enabled
It would be useful, but I don't currently have time to add it.
--
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][client] Fix double recycling of the message in isValidConsumerEpoch method [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #25008:
URL: https://github.com/apache/pulsar/pull/25008
--
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][client] Fix double recycling of the message in isValidConsumerEpoch method [pulsar]
Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on PR #25008:
URL: https://github.com/apache/pulsar/pull/25008#issuecomment-3573544399
I tried to add a test and found it's hard to test.
This bug does not affect correctness. It just throws an `IllegalStateException`, which will be handled by the `UncaughtExceptionHandler` from `ExtendedThreadFactory`. It's basically equivalent with returning false in this case.
--
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][client] Fix double recycling of the message in isValidConsumerEpoch method [pulsar]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #25008:
URL: https://github.com/apache/pulsar/pull/25008#issuecomment-3563677673
## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/25008?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 74.33%. Comparing base ([`807dcaf`](https://app.codecov.io/gh/apache/pulsar/commit/807dcaf5d928f8202c1bf8b8402cfcf72a41e63d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a3d7061`](https://app.codecov.io/gh/apache/pulsar/commit/a3d70612537f1260dfb677b8c3352a13c65f8174?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/pulsar/pull/25008?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #25008 +/- ##
============================================
+ Coverage 74.27% 74.33% +0.06%
- Complexity 33563 34073 +510
============================================
Files 1920 1920
Lines 150279 150278 -1
Branches 17448 17448
============================================
+ Hits 111618 111710 +92
+ Misses 29768 29670 -98
- Partials 8893 8898 +5
```
| [Flag](https://app.codecov.io/gh/apache/pulsar/pull/25008/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/25008/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.32% <ø> (?)` | |
| [systests](https://app.codecov.io/gh/apache/pulsar/pull/25008/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `22.84% <ø> (-0.01%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pulsar/pull/25008/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.87% <ø> (+<0.01%)` | :arrow_up: |
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/25008?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...va/org/apache/pulsar/client/impl/ConsumerBase.java](https://app.codecov.io/gh/apache/pulsar/pull/25008?src=pr&el=tree&filepath=pulsar-client%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fclient%2Fimpl%2FConsumerBase.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0NvbnN1bWVyQmFzZS5qYXZh) | `75.16% <ø> (-0.05%)` | :arrow_down: |
... and [100 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/25008/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][client] Fix double recycling of the message in isValidConsumerEpoch method [pulsar]
Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on PR #25008:
URL: https://github.com/apache/pulsar/pull/25008#issuecomment-3573669085
Eventually I added a test to verify no exception would be propagated to the internal executor: https://github.com/apache/pulsar/pull/25013
It could help avoid the possible regression in future to some extent.
--
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