-
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] Fix race-condition causing doReconsumeLater to hang when creating retryLetterProducer has failed #23560
Conversation
…reate retryLetterProducer is failed.
Do you have a chance to add a test case? |
I've added a test case. |
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.
LGTM, thanks for the contribution @hanmz
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #23560 +/- ##
============================================
+ Coverage 73.57% 74.04% +0.47%
- Complexity 32624 34650 +2026
============================================
Files 1877 1945 +68
Lines 139502 151644 +12142
Branches 15299 17232 +1933
============================================
+ Hits 102638 112289 +9651
- Misses 28908 30618 +1710
- Partials 7956 8737 +781
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…n creating retryLetterProducer has failed (apache#23560) (cherry picked from commit bf1f677) (cherry picked from commit 5f25367)
…n creating retryLetterProducer has failed (apache#23560) (cherry picked from commit bf1f677) (cherry picked from commit 5f25367)
Motivation
When
retryLetterProducer
creation fails,retryLetterProducer
will be set to null. SoretryLetterProducer==null
may occur when race-condition is present, at this time, the results cannot be completed.Only handle the situation when retryLetterProducer is not equal to null:
pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
Line 678 in 3f12269
Modifications
When
retryLetterProducer==null
, mark the result as an completeExceptionally.Documentation
doc
doc-required
doc-not-needed
doc-complete