poorbarcode commented on code in PR #21183:
URL: https://github.com/apache/pulsar/pull/21183#discussion_r1327569100
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractDispatcherSingleActiveConsumer.java:
##########
@@ -166,6 +166,10 @@ public synchronized CompletableFuture<Void>
addConsumer(Consumer consumer) {
}
if (subscriptionType == SubType.Exclusive && !consumers.isEmpty()) {
+ Consumer actConsumer = ACTIVE_CONSUMER_UPDATER.get(this);
+ if (actConsumer != null) {
+ actConsumer.cnx().checkConnectionLiveness();
+ }
Review Comment:
@codelipenghui
> But the new consumer will not retry to connect to the topic, right? Do we
need to wait for the connection liveness check to be done?
Sure, I did this improve.
<strong>(Highlight)</strong> I have a concern:
**Background**: the PR https://github.com/apache/pulsar/pull/20026 changed
the method `dispatcher.addConsumer` to an asynchronous method, it broke the
lock of `synchronized(dispathcer.this)`, this change only affected the releases
larger than `3.0.0`.
**Concern**: The improvement "wait for the connection liveness check done"
relies on the asynchronous method `dispatcher.addConsumer`. I am thinking about
whether to accept the patch https://github.com/apache/pulsar/pull/20026 and fix
the broken lock, or revert this patch to make the logic simple.
I'd like to know your advice.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]