eolivelli commented on a change in pull request #14853:
URL: https://github.com/apache/pulsar/pull/14853#discussion_r835880646
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java
##########
@@ -1196,13 +1111,16 @@ public void validateTopicOperation(TopicName topicName,
TopicOperation operation
}
}
- protected Void handleCommonRestAsyncException(AsyncResponse asyncResponse,
Throwable ex) {
- Throwable realCause = FutureUtil.unwrapCompletionException(ex);
- if (realCause instanceof WebApplicationException) {
- asyncResponse.resume(realCause);
- } else {
- asyncResponse.resume(new RestException(realCause));
+ public <T> T sync(Supplier<CompletableFuture<T>> supplier) {
+ try {
+ return
supplier.get().get(config().getMetadataStoreOperationTimeoutSeconds(), SECONDS);
+ } catch (InterruptedException | ExecutionException | TimeoutException
ex) {
+ Throwable realCause = FutureUtil.unwrapCompletionException(ex);
Review comment:
Please add something like this here:
```
if (ex instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]