You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "Technoboy- (via GitHub)" <gi...@apache.org> on 2023/09/18 06:21:11 UTC
[GitHub] [pulsar] Technoboy- commented on a diff in pull request #21183: [fix] [broker] Make the new exclusive consumer instead the inactive one faster
Technoboy- commented on code in PR #21183:
URL: https://github.com/apache/pulsar/pull/21183#discussion_r1328284037
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractDispatcherSingleActiveConsumer.java:
##########
@@ -166,7 +166,20 @@ public synchronized CompletableFuture<Void> addConsumer(Consumer consumer) {
}
if (subscriptionType == SubType.Exclusive && !consumers.isEmpty()) {
- return FutureUtil.failedFuture(new ConsumerBusyException("Exclusive consumer is already connected"));
+ Consumer actConsumer = ACTIVE_CONSUMER_UPDATER.get(this);
+ if (actConsumer != null) {
+ return actConsumer.cnx().checkConnectionLiveness().thenCompose(actConsumerStillAlive -> {
+ if (actConsumerStillAlive) {
Review Comment:
`checkConnectionLiveness` may return `null`, need to fix that also
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org