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



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/MessagingServiceShutdownHook.java
##########
@@ -59,9 +59,14 @@ public void run() {
 
             executor.execute(() -> {
                 try {
-                    service.close();
-                    future.complete(null);
-                } catch (PulsarServerException e) {
+                    service.closeAsync().whenComplete((result, throwable) -> {
+                        if (throwable != null) {
+                            future.completeExceptionally(throwable);
+                        } else {
+                            future.complete(result);
+                        }
+                    });
+                } catch (Exception e) {

Review comment:
       That change wouldn't simplify this code in MessagingServiceShutdownHook. 
   Unless the executor solution is modified, it's not possible get rid of the 
`.closeAsync().whenComplete` code block.
   




-- 
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:
[email protected]


Reply via email to