codelipenghui commented on code in PR #20573:
URL: https://github.com/apache/pulsar/pull/20573#discussion_r1228809167
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:
##########
@@ -1243,20 +1243,11 @@ protected void handleSubscribe(final CommandSubscribe
subscribe) {
return topic.subscribe(option);
}
})
- .thenAccept(consumer -> {
- if (consumerFuture.complete(consumer)) {
- log.info("[{}] Created subscription on topic
{} / {}",
- remoteAddress, topicName,
subscriptionName);
- commandSender.sendSuccessResponse(requestId);
- if (brokerInterceptor != null) {
- try {
-
brokerInterceptor.consumerCreated(this, consumer, metadata);
- } catch (Throwable t) {
- log.error("Exception occur when
intercept consumer created.", t);
- }
- }
- } else {
- // The consumer future was completed before by
a close command
+ .thenAcceptAsync(consumer -> {
+ if (consumerFuture.complete(consumer) ||
!isActive()) {
Review Comment:
```suggestion
if (!consumerFuture.complete(consumer) ||
!isActive()) {
```
--
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]