lhotari commented on a change in pull request #9308:
URL: https://github.com/apache/pulsar/pull/9308#discussion_r602712094
##########
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 put it back to "catch (Exception e) {" based on @merlimat's comment
about handle all exceptions (that was in another code location,
https://github.com/apache/pulsar/pull/9308#discussion_r602616184 ).
Catching RuntimeException is actually not sufficient on Java because there
are solutions like Lombok's SneakyThrows which allows to throw checked
exceptions. That's why it's better to simply catch all Exceptions.
--
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]