zentol commented on a change in pull request #17606:
URL: https://github.com/apache/flink/pull/17606#discussion_r739241181
##########
File path:
flink-rpc/flink-rpc-akka/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java
##########
@@ -240,17 +241,20 @@ private Object invokeRpc(Method method, Object[] args)
throws Exception {
final CompletableFuture<?> resultFuture = ask(rpcInvocation,
futureTimeout);
final CompletableFuture<Object> completableFuture = new
CompletableFuture<>();
- resultFuture.whenComplete(
- (resultValue, failure) -> {
- if (failure != null) {
- completableFuture.completeExceptionally(
- resolveTimeoutException(
- failure, callStackCapture,
address, rpcInvocation));
- } else {
- completableFuture.complete(
- deserializeValueIfNeeded(resultValue,
method));
- }
- });
+ FutureUtils.forward(
Review comment:
I was wondering if we even need the forwarding, or if we couldn't just do
```
final CompletableFuture<Object> completableFuture =
ask(rpcInvocation, futureTimeout)
.thenApply(...)
.exceptionally(...);
```
--
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]