eolivelli commented on a change in pull request #9308:
URL: https://github.com/apache/pulsar/pull/9308#discussion_r598632883
##########
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:
from this code it is difficult to understand why we have to catch a
generic Exception.
we are calling a `closeAsync()` and we are handing errors in the
`whenComplete` callback.
--
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]