oneby-wang opened a new pull request, #25208:
URL: https://github.com/apache/pulsar/pull/25208

   <!-- Either this PR fixes an issue, -->
   
   Fixes https://github.com/apache/pulsar/issues/25145
   
   ### Motivation
   
   See https://github.com/apache/pulsar/issues/25145#issuecomment-3798271727.
   
   Due to the use of Netty `Recycler`, a `ConcurrentBitSetRecyclable` instance 
may still be used after being recycled. However, recycling clears all bits, 
which may cause the `isDuplicate()` method return true under some race 
conditions.
   
   If we execute to the point where `bitSet != nul`l, but the thread is then 
switched out and `bitSet` gets recycled, the `isDuplicate()` method will return 
true at that point.
   
   
https://github.com/apache/pulsar/blob/cab92f0164947e3cbb0da1a014951561f1599add/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java#L135-L138
   
   ### Modifications
   
   Replace `ConcurrentBitSetRecyclable` with `ConcurrentBitSet`, ensure that 
`ackSet` is only cleared when the `ackXxx` method is invoked.
   
   As https://github.com/apache/pulsar/pull/24766 suggested, we should stop 
using Netty `Recycler` in new code. Since using Netty `Recycler` is kind of 
error prone way here, I think we should remove it.
   
   
   ### 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/oneby-wang/pulsar/pull/26


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to