You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/03/31 07:54:59 UTC
[GitHub] [flink] GJL commented on a change in pull request #11549:
[FLINK-16703][rpc] Set AkkaRpcActor state to TERMINATING when terminating
GJL commented on a change in pull request #11549: [FLINK-16703][rpc] Set AkkaRpcActor state to TERMINATING when terminating
URL: https://github.com/apache/flink/pull/11549#discussion_r400712084
##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActorTest.java
##########
@@ -395,6 +396,43 @@ public void testOnStartFails() throws Exception {
}
}
+ /**
+ * Tests that multiple termination calls won't trigger the onStop action multiple times.
+ * See FLINK-16703.
+ */
+ @Test
+ public void callsOnStopOnlyOnce() throws Exception {
+ final CompletableFuture<Void> onStopFuture = new CompletableFuture<>();
+ final OnStopCountingRpcEndpoint endpoint = new OnStopCountingRpcEndpoint(akkaRpcService, onStopFuture);
+
+ try {
+ endpoint.start();
+
+ final AkkaBasedEndpoint selfGateway = endpoint.getSelfGateway(AkkaBasedEndpoint.class);
+
+ // try to terminate the actor twice
+ selfGateway.getActorRef().tell(ControlMessages.TERMINATE, ActorRef.noSender());
+ selfGateway.getActorRef().tell(ControlMessages.TERMINATE, ActorRef.noSender());
+
+ // wait a bit so that both terminate messages can be processed
+ try {
+ endpoint.getTerminationFuture().get(10L, TimeUnit.MILLISECONDS);
Review comment:
Is there no better way to drain the messages?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services