kaisun2000 commented on a change in pull request #1227:
URL: https://github.com/apache/helix/pull/1227#discussion_r494731321



##########
File path: 
helix-core/src/main/java/org/apache/helix/task/TaskStateModelFactory.java
##########
@@ -97,7 +97,7 @@ public void shutdown() {
   }
 
   @VisibleForTesting
-  void shutdownNow() {
+  public void shutdownNow() {

Review comment:
       
helix-core/src/test/java/org/apache/helix/integration/multizk/TestMultiZkHelixJavaApis.java
   actually leaks hundreds of threads.
   We need to call this method to avoid the thread leak
   ```
   public void afterClass() throws Exception {
       String testClassName = getClass().getSimpleName();
       System.out.println("AfterClass: " + testClassName + " of 
TestMultiZkHelixJavaApis called.");
   
       try {
         // Kill all mock controllers and participants
         MOCK_CONTROLLERS.values().forEach(ClusterControllerManager::syncStop);
         MOCK_PARTICIPANTS.forEach(mockParticipantManager -> {
           mockParticipantManager.syncStop();
           StateMachineEngine stateMachine = 
mockParticipantManager.getStateMachineEngine();
           if (stateMachine != null) {
             StateModelFactory stateModelFactory = 
stateMachine.getStateModelFactory("Task");
             if (stateModelFactory != null && stateModelFactory instanceof 
TaskStateModelFactory) {
               ((TaskStateModelFactory) stateModelFactory).shutdownNow();
             }
           }
         });
   
   ```




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to