merlimat commented on a change in pull request #9308:
URL: https://github.com/apache/pulsar/pull/9308#discussion_r602616184



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
##########
@@ -692,12 +710,20 @@ public void close() throws IOException {
         messagePublishBufferMonitor.shutdown();
         consumedLedgersMonitor.shutdown();
         backlogQuotaChecker.shutdown();
-        authenticationService.close();
+        try {
+            authenticationService.close();
+        } catch (IOException e) {
+            return FutureUtil.failedFuture(e);

Review comment:
       Should we have a try/catch for the entries method instead of the 
individual checks. That would also ensure we don't forget any of them (and we 
also handle unchecked exceptions)

##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
##########
@@ -238,6 +240,7 @@
 
     private final ReentrantLock mutex = new ReentrantLock();
     private final Condition isClosedCondition = mutex.newCondition();
+    private final AtomicReference<CompletableFuture<Void>> 
closeFutureReference = new AtomicReference<>();

Review comment:
       Since we're not doing any CAS operations (just get and set), we don't 
the `AtomicReference`, but just makie the variable `volatile`.




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to