You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/08/13 21:03:26 UTC

[GitHub] [helix] kaisun2000 opened a new issue #1266: Fix flaky TestClusterStateVerifier due to local variable reference which can be GC-ed

kaisun2000 opened a new issue #1266:
URL: https://github.com/apache/helix/issues/1266


   TestClusterStateVerifier sometimes fails with log:
   
   >2020-08-08T10:12:24.8447598Z [ERROR] testResourceSubset(org.apache.helix.tools.TestClusterStateVerifier)  Time elapsed: 1.012 s  <<< FAILURE!
   2020-08-08T10:12:24.8448106Z org.apache.helix.HelixException: Failed to create pause signal
   2020-08-08T10:12:24.8449142Z 	at org.apache.helix.tools.TestClusterStateVerifier.testResourceSubset(TestClusterStateVerifier.java:115)
   2020-08-08T10:12:24.8449351Z 
   2020-08-08T10:12:24.8450141Z [ERROR] afterMethod(org.apache.helix.tools.TestClusterStateVerifier)  Time elapsed: 1.036 s  <<< FAILURE!
   2020-08-08T10:12:24.8450566Z java.lang.IllegalStateException: ZkClient already closed!
   2020-08-08T10:12:24.8451566Z 	at org.apache.helix.tools.TestClusterStateVerifier.afterMethod(TestClusterStateVerifier.java:98)
   
   Reason:
   _admin refers to zkClient in local variable. The local variable setupTool later gets GCed and finalizer would call "close()" which shuts down the zkClient. Thus, later when _admin is used, it would throw exception, which fail the test at a not assert location.
   
   ```
   
   public class TestClusterStateVerifier extends ZkUnitTestBase {  final String[] RESOURCES = {      "resource0", "resource1"  };  private HelixAdmin _admin;  private MockParticipantManager[] _participants;  private ClusterControllerManager _controller;  private String _clusterName;   @BeforeMethod  public void beforeMethod() throws InterruptedException {    final int NUM_PARTITIONS = 1;    final int NUM_REPLICAS = 1;     // Cluster and resource setup    String className = TestHelper.getTestClassName();    String methodName = TestHelper.getTestMethodName();    _clusterName = className + "_" + methodName;    ClusterSetup setupTool = new ClusterSetup(ZK_ADDR);    _admin = setupTool.getClusterManagementTool();                 // --------------> _admin refers to an ZkClient in local variable setupTool.    setupTool.addCluster(_clusterName, true);    setupTool.addResourceToCluster(_cl
 usterName, RESOURCES[0], NUM_PARTITIONS, "OnlineOffline",        RebalanceMode.SEMI_AUTO.toString());    setupTool.addResourceToCluster(_clusterName, RESOURCES[1], NUM_PARTITIONS, "OnlineOffline",        RebalanceMode.SEMI_AUTO.toString());
   --
   
   ```


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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] jiajunwang closed issue #1266: Fix flaky TestClusterStateVerifier due to local variable reference which can be GC-ed

Posted by GitBox <gi...@apache.org>.
jiajunwang closed issue #1266:
URL: https://github.com/apache/helix/issues/1266


   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] jiajunwang commented on issue #1266: Fix flaky TestClusterStateVerifier due to local variable reference which can be GC-ed

Posted by GitBox <gi...@apache.org>.
jiajunwang commented on issue #1266:
URL: https://github.com/apache/helix/issues/1266#issuecomment-849103540


   Close test unstable tickets since we have an automatic tracking mechanism https://github.com/apache/helix/pull/1757 now for tracking the most recent test issues.


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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] kaisun2000 commented on issue #1266: Fix flaky TestClusterStateVerifier due to local variable reference which can be GC-ed

Posted by GitBox <gi...@apache.org>.
kaisun2000 commented on issue #1266:
URL: https://github.com/apache/helix/issues/1266#issuecomment-673727373


   fixed by #1227 


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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org