-
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] Release the orphan producers after the primary consumer is closed #19858
[fix][client] Release the orphan producers after the primary consumer is closed #19858
Conversation
return closeFuture; | ||
return closeFuture.thenCompose(ignore -> { | ||
if (retryLetterProducer != null){ | ||
return retryLetterProducer.closeAsync(); |
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.
Should we close them parallelly? Do you think we should make some special exception handling here?
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.
Should we close them parallelly?
Fixed.
Do you think we should make some special exception handling here?
Yes, if closing these producers fail, users can not retry to close them again, so just print a warning log. Or two other implementations:
- Make this method retryable.
- Do retry these producers' close silently
Since there are few scenarios where failure occurs, such as when the connection has been broken (no longer necessary to retry the close), just print a warning log.
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, good catch!
Codecov Report
@@ Coverage Diff @@
## master #19858 +/- ##
=============================================
+ Coverage 25.11% 38.16% +13.05%
- Complexity 205 1364 +1159
=============================================
Files 1680 1686 +6
Lines 127176 133729 +6553
Branches 13863 15400 +1537
=============================================
+ Hits 31942 51040 +19098
+ Misses 90242 75961 -14281
- Partials 4992 6728 +1736
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Nice catch!
/pulsarbot rerun-failure-checks |
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.
Great work! I had tried to fix this a long time ago with #10159 but it was never completed.
… is closed (#19858) Motivation: The producers ["retryLetterProducer", "deadLetterProducer"] will be auto-created by consumers if enabled `DLQ`, but these producers will not close after consumers are closed. Modifications: Auto close "retryLetterProducer" and "deadLetterProducer" after the primary consumer is closed (cherry picked from commit 94ae340)
… is closed (#19858) Motivation: The producers ["retryLetterProducer", "deadLetterProducer"] will be auto-created by consumers if enabled `DLQ`, but these producers will not close after consumers are closed. Modifications: Auto close "retryLetterProducer" and "deadLetterProducer" after the primary consumer is closed (cherry picked from commit 94ae340)
… is closed (apache#19858) Motivation: The producers ["retryLetterProducer", "deadLetterProducer"] will be auto-created by consumers if enabled `DLQ`, but these producers will not close after consumers are closed. Modifications: Auto close "retryLetterProducer" and "deadLetterProducer" after the primary consumer is closed (cherry picked from commit 94ae340) (cherry picked from commit a0ff522)
Motivation
The producers ["retryLetterProducer", "deadLetterProducer"] will be auto-created by consumers if enabled
DLQ
, but these producers will not close after consumers are closed.Modifications
Auto close "retryLetterProducer" and "deadLetterProducer" after the primary consumer is closed
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: