BewareMyPower opened a new pull request, #23833:
URL: https://github.com/apache/pulsar/pull/23833

   ### Motivation
   
   `MLPendingAckStoreTest#testMainProcess` will fail by NPE if batch index ACK 
is enabled. The NPE happens when the position argument does not has a non-null 
`ackSet`.
   
   <!-- Explain here the context, and why you're making that change. What is 
the problem you're trying to solve. -->
   
   ### Modifications
   
   - Add an `ackBatchPosition` method to handle `Optional` objects correctly 
with elegant and clear code.
   - Make `BitSetRecycable#recycle()` call safe to be called multiple times so 
that it can be called in `ConcurrentSkipListMap`'s callback, which is not 
guaranteed to be called only once.
   - Mark `batchDeletedIndexes` as `@Nullable` and check if it's not null 
instead of `getConfig().isDeletionAtBatchIndexLevelEnabled()` to eliminate all 
NPE warnings.
   
   ### Verifying this change
   
   Enable batch index ACK in `MLPendingAckStoreTest` and guarantee this test 
passes.
   
   ### 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:


-- 
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