[Bug][Client] Consumer lost message ack due to race condition in acknowledge with batch message #22352
Closed
3 tasks done
Labels
type/bug
The PR fixed a bug or issue reported a bug
Search before asking
Read release policy
Version
pulsar-client: 3.0.3
(This issue may affect pulsar-client version 3.0.0 or later. #19414)
Minimal reproduce step
persistent://public/default/clientBlockTest
topic stats
What did you expect to see?
consume normally
What did you see instead?
Symptoms
ConsumerImpl#unAckedMessageTracker
mechanism still workingAnything else?
After investigation, I believe that the cause is that we haven't synchronize operations on Bitset in batch message, Consumer#acknowledge will be called from user threads, therefor operations on Bitset should be protected.
pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java
Lines 212 to 222 in a52945b
pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageIdAdvUtils.java
Lines 53 to 59 in a52945b
Are you willing to submit a PR?
[fix][client] Consumer lost message ack due to race condition in acknowledge with batch message #22353
The text was updated successfully, but these errors were encountered: