eolivelli commented on a change in pull request #9308:
URL: https://github.com/apache/pulsar/pull/9308#discussion_r598652533
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
##########
@@ -640,8 +643,22 @@ public synchronized void
setupBrokerPublishRateLimiterMonitor() {
}
}
- @Override
public void close() throws IOException {
+ try {
+ closeAsync().get();
+ } catch (ExecutionException e) {
+ if (e.getCause() instanceof IOException) {
+ throw (IOException) e.getCause();
+ }
+ throw new PulsarServerException(e.getCause());
+ } catch (IOException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new PulsarServerException(e);
+ }
+ }
+
+ public CompletableFuture<Void> closeAsync() throws IOException {
Review comment:
here we have the same problem, a method that returns CompletableFuture
should not "throw" exceptions.
Because the caller is expected to handle errors using the CompletableFuture
API
--
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]