yanghua 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_r246443067
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActorTest.java
 ##########
 @@ -144,6 +147,68 @@ public void testMessageDiscarding() throws Exception {
                rpcEndpoint.shutDown();
        }
 
+       @Test(expected = ExecutionException.class)
+       public void testOversizedResponseMsg() throws Exception {
+               Configuration configuration = new Configuration();
+               configuration.setString(AkkaOptions.FRAMESIZE, "10 b");
+               AkkaRpcService rpcService = null;
+               OversizedResponseRpcEndpoint rpcEndpoint = null;
+               try {
+                       rpcService = new TestingRemoteRpcService(configuration);
+
+                       rpcEndpoint = new 
OversizedResponseRpcEndpoint(rpcService);
+
+                       OversizedResponseMsgRpcGateway rpcGateway = 
rpcEndpoint.getSelfGateway(OversizedResponseMsgRpcGateway.class);
+
+                       rpcEndpoint.start();
+
+                       CompletableFuture<Byte[]> result = 
rpcGateway.calculate();
+
+                       result.get(timeout.getSize(), timeout.getUnit());
+
+                       fail("Expected a ExecutionException about the 
oversize");
+               } finally {
 
 Review comment:
   @tillrohrmann When I accept the next suggestion (use two `RpcService` to 
mock real remote RPC), it will throw this exception : 
   
   ```
   java.lang.reflect.UndeclaredThrowableException
        at org.apache.flink.runtime.rpc.akka.$Proxy8.calculate(Unknown Source)
        at 
org.apache.flink.runtime.rpc.akka.AkkaRpcActorTest.testOversizedResponseMsg(AkkaRpcActorTest.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
        at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
        at 
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
        at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
        at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
   Caused by: java.io.IOException: The rpc invocation size exceeds the maximum 
akka framesize.
        at 
org.apache.flink.runtime.rpc.akka.AkkaInvocationHandler.createRpcInvocationMessage(AkkaInvocationHandler.java:262)
        at 
org.apache.flink.runtime.rpc.akka.AkkaInvocationHandler.invokeRpc(AkkaInvocationHandler.java:211)
        at 
org.apache.flink.runtime.rpc.akka.AkkaInvocationHandler.invoke(AkkaInvocationHandler.java:127)
        ... 28 more
   ```

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