-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix][client] Consumer lost message ack due to race condition in acknowledge with batch message #22353
Conversation
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageIdAdvUtils.java
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageIdAdvUtils.java
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageIdAdvUtils.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to update the API documentation as well. We must note that any read or modification on the return value of MessageIdAdv#getAckSet()
should be synchronized on the lock as well.
It should be comments rather than approved
pulsar-common/src/main/java/org/apache/pulsar/client/api/MessageIdAdv.java
Outdated
Show resolved
Hide resolved
…geIdAdv.java Co-authored-by: Yunze Xu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some questions about the test case.
pulsar-client/src/test/java/org/apache/pulsar/client/impl/MessageIdAdvUtilsTest.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/test/java/org/apache/pulsar/client/impl/MessageIdAdvUtilsTest.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/test/java/org/apache/pulsar/client/impl/MessageIdAdvUtilsTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work @Shawyeok
/pulsarbot rerun-failure-checks |
Thank you for review and suggestions. @lhotari @BewareMyPower @poorbarcode |
…owledge with batch message (#22353) Co-authored-by: Yunze Xu <[email protected]> Co-authored-by: 汪苏诚 <[email protected]> (cherry picked from commit 3fa2ae8)
…owledge with batch message (#22353) Co-authored-by: Yunze Xu <[email protected]> Co-authored-by: 汪苏诚 <[email protected]> (cherry picked from commit 3fa2ae8)
…owledge with batch message (apache#22353) Co-authored-by: Yunze Xu <[email protected]> Co-authored-by: 汪苏诚 <[email protected]>
…owledge with batch message (apache#22353) Co-authored-by: Yunze Xu <[email protected]> Co-authored-by: 汪苏诚 <[email protected]> (cherry picked from commit 3fa2ae8) (cherry picked from commit 9c50d18)
…owledge with batch message (apache#22353) Co-authored-by: Yunze Xu <[email protected]> Co-authored-by: 汪苏诚 <[email protected]> (cherry picked from commit 3fa2ae8) (cherry picked from commit 9c50d18)
…owledge with batch message (apache#22353) Co-authored-by: Yunze Xu <[email protected]> Co-authored-by: 汪苏诚 <[email protected]> (cherry picked from commit 3fa2ae8) (cherry picked from commit 9c50d18)
…owledge with batch message (apache#22353) Co-authored-by: Yunze Xu <[email protected]> Co-authored-by: 汪苏诚 <[email protected]> (cherry picked from commit 3fa2ae8) (cherry picked from commit 9c50d18)
…owledge with batch message (apache#22353) Co-authored-by: Yunze Xu <[email protected]> Co-authored-by: 汪苏诚 <[email protected]> (cherry picked from commit 3fa2ae8) (cherry picked from commit 9c50d18)
…owledge with batch message (apache#22353) Co-authored-by: Yunze Xu <[email protected]> Co-authored-by: 汪苏诚 <[email protected]>
Motivation
Fixes #22352
Modifications
Add synchronize protection on bitset operations acknowledge with batch message
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: Shawyeok#15