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



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
##########
@@ -296,16 +299,31 @@ public MetadataStoreExtended 
createConfigurationMetadataStore() throws MetadataS
                         .build());
     }
 
+    @Override
+    public void close() throws PulsarServerException {
+        try {
+            closeAsync().get();
+        } catch (PulsarServerException e) {
+            throw e;
+        } catch (ExecutionException e) {
+            if (e.getCause() instanceof PulsarServerException) {
+                throw (PulsarServerException) e.getCause();
+            } else {
+                throw new PulsarServerException(e.getCause());
+            }
+        } catch (Exception e) {
+            throw new PulsarServerException(e);
+        }
+    }
+
     /**
      * Close the current pulsar service. All resources are released.
      */
-    @Override
-    public void close() throws PulsarServerException {
+    public CompletableFuture<Void> closeAsync() throws PulsarServerException {

Review comment:
       > for instance this code looks bad
   
   What specifically is "bad" there?




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