-
Notifications
You must be signed in to change notification settings - Fork 69
[Bug] Deadlock for negative acknowledgment #265
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
Comments
BewareMyPower
added a commit
to BewareMyPower/pulsar-client-cpp
that referenced
this issue
May 6, 2023
Fixes apache#265 ### Modifications Make `timer_` const and `enabledForTesting_` atomic in `NegativeAcksTracker` so that the `mutex_` can be used only for the `nackedMessages_` field. After that, we can unlock `mutex_` in `handleTimer` to avoid the potential deadlock from user-provided logger or intercepter. Add `ConsumerTest.testNegativeAckDeadlock` to verify the fix.
4 tasks
BewareMyPower
added a commit
that referenced
this issue
May 6, 2023
Fixes #265 ### Modifications Make `timer_` const and `enabledForTesting_` atomic in `NegativeAcksTracker` so that the `mutex_` can be used only for the `nackedMessages_` field. After that, we can unlock `mutex_` in `handleTimer` to avoid the potential deadlock from user-provided logger or intercepter. Add `ConsumerTest.testNegativeAckDeadlock` to verify the fix.
BewareMyPower
added a commit
that referenced
this issue
May 6, 2023
Fixes #265 ### Modifications Make `timer_` const and `enabledForTesting_` atomic in `NegativeAcksTracker` so that the `mutex_` can be used only for the `nackedMessages_` field. After that, we can unlock `mutex_` in `handleTimer` to avoid the potential deadlock from user-provided logger or intercepter. Add `ConsumerTest.testNegativeAckDeadlock` to verify the fix. (cherry picked from commit 8a9b2dc)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Search before asking
Version
Minimal reproduce step
What did you expect to see?
The application should stop after a few seconds.
What did you see instead?
The application hangs forever. Here are the key stacks that show the deadlock:
Anything else?
Though the reproduce code uses the intercepter feature that is not included in any release, this bug also affects the Python client that depends on any existing C++ client. See detailed analysis in apache/pulsar-client-python#116 (comment)
This deadlock issue could also be reproduced for a custom logger. That's why apache/pulsar-client-python#116 suffers this bug.
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: