[ 
https://issues.apache.org/jira/browse/FLINK-10251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16655422#comment-16655422
 ] 

ASF GitHub Bot commented on FLINK-10251:
----------------------------------------

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_r226348261
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActor.java
 ##########
 @@ -263,14 +274,41 @@ private void handleRpcInvocation(RpcInvocation 
rpcInvocation) {
                                                                if (throwable 
!= null) {
                                                                        
promise.failure(throwable);
                                                                } else {
-                                                                       
promise.success(value);
+                                                                       long 
resultSize = 0;
+                                                                       if 
(isRemoteSender) {
+                                                                               
try {
+                                                                               
        resultSize = new SerializedValue(value).getByteArray().length;
+                                                                               
        if (resultSize > maximumFramesize) {
+                                                                               
                promise.failure(new Throwable("The result size exceeds the 
maximum " +
+                                                                               
                        "size, result size is " + resultSize + ", maximum frame 
size is " +
+                                                                               
                        maximumFramesize + " ."));
+                                                                               
        } else {
+                                                                               
                promise.success(value);
+                                                                               
        }
+                                                                               
} catch (IOException e) {
+                                                                               
        promise.failure(e);
 
 Review comment:
   Maybe wrap in `AkkaRpcException("Failed to serialize the result for RPC call 
%s.", e)`

----------------------------------------------------------------
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]


> Handle oversized response messages in AkkaRpcActor
> --------------------------------------------------
>
>                 Key: FLINK-10251
>                 URL: https://issues.apache.org/jira/browse/FLINK-10251
>             Project: Flink
>          Issue Type: Improvement
>          Components: Distributed Coordination
>    Affects Versions: 1.5.3, 1.6.0, 1.7.0
>            Reporter: Till Rohrmann
>            Assignee: vinoyang
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.5.6, 1.6.3, 1.7.0
>
>
> The {{AkkaRpcActor}} should check whether an RPC response which is sent to a 
> remote sender does not exceed the maximum framesize of the underlying 
> {{ActorSystem}}. If this is the case we should fail fast instead. We can 
> achieve this by serializing the response and sending the serialized byte 
> array.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to