[fix] [broker] Close dispatchers stuck due to mismatch between dispatcher.consumerList and dispatcher.consumerSet#22270
Conversation
…consumerList and dispatcher.consumerSet
.../java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22270 +/- ##
============================================
+ Coverage 73.57% 73.68% +0.10%
- Complexity 32624 32802 +178
============================================
Files 1877 1887 +10
Lines 139502 139488 -14
Branches 15299 15293 -6
============================================
+ Hits 102638 102778 +140
+ Misses 28908 28750 -158
- Partials 7956 7960 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
codelipenghui
left a comment
There was a problem hiding this comment.
It looks like we don't need this PR if we follow this comment to fix the issue. I have tested on my laptop.
Changed the implementation: Just add a defensive code to avoid the topic not being unloaded anymore: remove the consumers which are not mismatched between |
|
/pulsarbot rerun-failure-checks |
…cher.consumerList and dispatcher.consumerSet (apache#22270) (cherry picked from commit cba1600) (cherry picked from commit 94edfe4)
…cher.consumerList and dispatcher.consumerSet (apache#22270) (cherry picked from commit cba1600) (cherry picked from commit 94edfe4)
…cher.consumerList and dispatcher.consumerSet (apache#22270) (cherry picked from commit cba1600) (cherry picked from commit 94edfe4)
…cher.consumerList and dispatcher.consumerSet (apache#22270) (cherry picked from commit cba1600) (cherry picked from commit 94edfe4)
…cher.consumerList and dispatcher.consumerSet (apache#22270) (cherry picked from commit cba1600) (cherry picked from commit 94edfe4)
…cher.consumerList and dispatcher.consumerSet (apache#22270) (cherry picked from commit cba1600)
…cher.consumerList and dispatcher.consumerSet (apache#22270)
Motivation
The logs were printed on our cluster(
2.11.2){clientCnx 127.0.0.6:44907, consumerId: 18}has been removed twice when callingdispatcher.disconnectAllConsumers.[1]Trying to remove a non-connected consumerwhen removing the consumer{clientCnx 127.0.0.6:44907, consumerId: 18}at the second time, which means this consumer is duplicated indispatcher.consumerList.[2]closeFutureofdispatcherwill never be completed, leading to the process oftopic.deletebeing stuck.[1]: dispatcher.disconnectAllConsumers
[2]: dispatcher.removeConsumer
Modifications
I haven't found the logic of repeating consumer in
dispatcher.consumerListyet(it may caused by a consumer that has been added twice, anddispatcher.consumerSetmerged two adding), I just fixed the follow-up issue.Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: x