tillrohrmann commented on a change in pull request #6876: [FLINK-10251] Handle 
oversized response messages in AkkaRpcActor
URL: https://github.com/apache/flink/pull/6876#discussion_r246342045
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java
 ##########
 @@ -123,6 +125,21 @@ public Object invoke(Object proxy, Method method, 
Object[] args) throws Throwabl
                                "retrieve a properly FencedRpcGateway.");
                } else {
                        result = invokeRpc(method, args);
+                       if (result instanceof CompletableFuture) {
+                               result = ((CompletableFuture) 
result).thenApply((Object o) -> {
+                                       if (o instanceof SerializedValue) {
+                                               try {
+                                                       return  
((SerializedValue) o).deserializeValue(getClass().getClassLoader());
+                                               } catch (IOException e) {
+                                                       throw new 
CompletionException(e);
+                                               } catch (ClassNotFoundException 
e) {
+                                                       throw new 
CompletionException(e);
+                                               }
+                                       } else {
+                                               return o;
+                                       }
+                               });
+                       }
 
 Review comment:
   This block should go into the `invokeRpc` method because we also need to 
unwrap the synchronous calls.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to