lhotari commented on code in PR #17524:
URL: https://github.com/apache/pulsar/pull/17524#discussion_r1581892388
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -1605,40 +1691,74 @@ public CompletableFuture<Void> close(
}
}
- CompletableFuture<Void> clientCloseFuture =
closeWithoutWaitingClientDisconnect
- ? CompletableFuture.completedFuture(null)
- : FutureUtil.waitForAll(futures);
+ CompletableFuture<Void> disconnectClientsInCurrentCall = null;
+ // Note: "disconnectClientsToCache" is a non-able value, it is null
when close type is transferring.
+ MutableObject<CompletableFuture<Void>> disconnectClientsToCache = new
MutableObject<>();
Review Comment:
It's better to use AtomicReference instead of MutableObject since the value
is passed to another thread.
--
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]