lhotari commented on a change in pull request #9308:
URL: https://github.com/apache/pulsar/pull/9308#discussion_r602058441
##########
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:
I changed it to be "catch (RuntimeException e) {" . It's necessary to
catch possible runtime exceptions. Since there's no more checked exceptions in
the most recent changes, it's sufficient to catch RuntimeExceptions. Are you
fine with this?
--
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]