You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/08/11 10:33:02 UTC

[GitHub] [ignite-3] SammyVimes commented on a change in pull request #269: IGNITE-15196 Fail invoke futures on network stop

SammyVimes commented on a change in pull request #269:
URL: https://github.com/apache/ignite-3/pull/269#discussion_r686702845



##########
File path: modules/network/src/integrationTest/java/org/apache/ignite/network/scalecube/ITScaleCubeNetworkMessagingTest.java
##########
@@ -210,6 +214,44 @@ public void testInvokeMessageToSelf() throws Exception {
         assertThat(actualResponseMessage.msg(), is(responseMessage.msg()));
     }
 
+    /**
+     * Tests that if the network component is stopped while waiting for a response to an "invoke" call,
+     * the corresponding future completes exceptionally.
+     */
+    @Test
+    public void testInvokeDuringStop() throws InterruptedException {
+        testCluster = new Cluster(2);
+        testCluster.startAwait();
+
+        ClusterService member0 = testCluster.members.get(0);
+        ClusterService member1 = testCluster.members.get(1);
+
+        // we don't register a message listener on the receiving size, so all "invoke"s should timeout

Review comment:
       ```suggestion
           // we don't register a message listener on the receiving side, so all "invoke"s should timeout
   ```

##########
File path: modules/network/src/integrationTest/java/org/apache/ignite/network/scalecube/ITScaleCubeNetworkMessagingTest.java
##########
@@ -210,6 +214,44 @@ public void testInvokeMessageToSelf() throws Exception {
         assertThat(actualResponseMessage.msg(), is(responseMessage.msg()));
     }
 
+    /**
+     * Tests that if the network component is stopped while waiting for a response to an "invoke" call,
+     * the corresponding future completes exceptionally.
+     */
+    @Test
+    public void testInvokeDuringStop() throws InterruptedException {
+        testCluster = new Cluster(2);
+        testCluster.startAwait();
+
+        ClusterService member0 = testCluster.members.get(0);
+        ClusterService member1 = testCluster.members.get(1);
+
+        // we don't register a message listener on the receiving size, so all "invoke"s should timeout
+
+        // perform two invokes to test that multiple requests can get cancelled
+        CompletableFuture<NetworkMessage> invoke0 = member0.messagingService().invoke(

Review comment:
       Maybe we can replace two separate invocations with a cycle?




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org