Details
-
Bug
-
Resolution: Done
-
Major
-
10.0.0.Beta3, 9.4.14.Final
-
DataGrid Sprint #29
Description
SingleTargetRequest.onNewView() is sometimes invoked twice:
- From JGroupsTransport.invokeCommand(), in the thread that is sending the request
- From JGroupsTransport.receiveClusterView(), in the thread processing the view change
Because of insufficient synchronization, both onNewView() invocations may trigger a call to ResponseCollector.addResponse(), and the collector may not deal with the extra call properly.
For example, the bridge response collectors used by ControlledRpcManager do not allow duplicate responses for the same target, and this causes random failures in GetAllCommandNodeCrashTest:
12:44:56.270 [ERROR] commands.GetAllCommandNodeCrashTest(org.infinispan.commands.GetAllCommandNodeCrashTest) Time elapsed: 0.144 s <<< FAILURE! java.lang.AssertionError: at org.testng.AssertJUnit.fail(AssertJUnit.java:59) at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24) at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41) at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49) at org.infinispan.util.ControlledRpcManager$BlockedResponseMap.receive(ControlledRpcManager.java:701) at org.infinispan.util.ControlledRpcManager$SentRequest.receiveAll(ControlledRpcManager.java:601) at org.infinispan.commands.GetAllCommandNodeCrashTest.test(GetAllCommandNodeCrashTest.java:66)