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/01 00:57:54 UTC

[GitHub] [helix] kaisun2000 opened a new pull request #1201: Identify and shutdown leaked timer threads #1200

kaisun2000 opened a new pull request #1201:
URL: https://github.com/apache/helix/pull/1201


   ### Issues
   
   - [x] My PR addresses the following Helix issues and references them in the PR description:
   
   fixes #1200 
   
   ### Description
   
   - [ ] Here are some details about my PR, including screenshots of any UI changes:
   
       Unit test has leaked several hundreds to thousand leaked timer threads.
       This pull request give each timer thread a name to help identified the
       leaked threads. Also fix the major contributor of leaking in controller.
   
   ### Tests
   
   - [ ] The following tests are written for this issue:
   
   none.
   
   - [ ] The following is the result of the "mvn test" command on the appropriate module:
   
   running
   
   ### Commits
   
   - [ ] My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation (Optional)
   
   - [ ] In case of new functionality, my PR adds documentation in the following wiki page:
   
   (Link the GitHub wiki you added)
   
   ### Code Quality
   
   - [ ] My diff has been formatted using helix-style.xml 
   (helix-style-intellij.xml if IntelliJ IDE is used)


----------------------------------------------------------------
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 pull request #1201: Identify and shutdown leaked timer threads

Posted by GitBox <gi...@apache.org>.
jiajunwang commented on pull request #1201:
URL: https://github.com/apache/helix/pull/1201#issuecomment-669534468


   @kaisun2000 could you please confirm if the test can pass with re-run? And please confirm that the change does not make the test unstable.


----------------------------------------------------------------
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 a change in pull request #1201: Identify and shutdown leaked timer threads

Posted by GitBox <gi...@apache.org>.
jiajunwang commented on a change in pull request #1201:
URL: https://github.com/apache/helix/pull/1201#discussion_r465395841



##########
File path: helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
##########
@@ -1272,7 +1280,7 @@ protected void checkLiveInstancesObservation(List<LiveInstance> liveInstances,
 
   public void shutdown() throws InterruptedException {
     stopPeriodRebalance();
-
+    stopOnDemandTimer();

Review comment:
       Shall we also stopOnDemandTimer on the FINALIZE notification? This is done for the PeriodRebalance timer.




----------------------------------------------------------------
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 a change in pull request #1201: Identify and shutdown leaked timer threads

Posted by GitBox <gi...@apache.org>.
jiajunwang commented on a change in pull request #1201:
URL: https://github.com/apache/helix/pull/1201#discussion_r465921998



##########
File path: helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
##########
@@ -1272,7 +1280,7 @@ protected void checkLiveInstancesObservation(List<LiveInstance> liveInstances,
 
   public void shutdown() throws InterruptedException {
     stopPeriodRebalance();
-
+    stopOnDemandTimer();

Review comment:
       In theory, if a FINALIZE notification comes, then we should stop any pending tasks. Or it will keep running even without the later INIT notification comes.
   But I agree that this PR won't make it worse. We can skip that change for now.




----------------------------------------------------------------
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 a change in pull request #1201: Identify and shutdown leaked timer threads

Posted by GitBox <gi...@apache.org>.
kaisun2000 commented on a change in pull request #1201:
URL: https://github.com/apache/helix/pull/1201#discussion_r465953384



##########
File path: helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
##########
@@ -357,6 +358,12 @@ void stopPeriodRebalance() {
     }
   }
 
+  private void stopOnDemandTimer() {

Review comment:
       changed.




----------------------------------------------------------------
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 a change in pull request #1201: Identify and shutdown leaked timer threads

Posted by GitBox <gi...@apache.org>.
kaisun2000 commented on a change in pull request #1201:
URL: https://github.com/apache/helix/pull/1201#discussion_r465405655



##########
File path: helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
##########
@@ -1272,7 +1280,7 @@ protected void checkLiveInstancesObservation(List<LiveInstance> liveInstances,
 
   public void shutdown() throws InterruptedException {
     stopPeriodRebalance();
-
+    stopOnDemandTimer();

Review comment:
       I noticed it too. periodicalRebalanceTimer would be canceled in Finalize and created in init time. But this timer (added for p2p) did not do this. Maybe it is for a reason. (Not that familiar with P2P) I am afraid changing its life cycle may cause some unexpected behavior. 




----------------------------------------------------------------
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 pull request #1201: Identify and shutdown leaked timer threads

Posted by GitBox <gi...@apache.org>.
kaisun2000 commented on pull request #1201:
URL: https://github.com/apache/helix/pull/1201#issuecomment-669615635


   > @kaisun2000 could you please confirm if the test can pass with re-run? And please confirm that the change does not make the test unstable.
   
   Yes, I re-run every failed test and they all can pass in one shot.


----------------------------------------------------------------
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 pull request #1201: Identify and shutdown leaked timer threads

Posted by GitBox <gi...@apache.org>.
kaisun2000 commented on pull request #1201:
URL: https://github.com/apache/helix/pull/1201#issuecomment-669483519


   This pull request is approved, please help to merge. Description
   
   > Unit test has leaked several hundreds to thousand leaked timer threads.
   This pull request give each timer thread a name to help identified the
   leaked threads. Also fix the major contributor of leaking in controller.


----------------------------------------------------------------
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 merged pull request #1201: Identify and shutdown leaked timer threads

Posted by GitBox <gi...@apache.org>.
jiajunwang merged pull request #1201:
URL: https://github.com/apache/helix/pull/1201


   


----------------------------------------------------------------
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 a change in pull request #1201: Identify and shutdown leaked timer threads

Posted by GitBox <gi...@apache.org>.
kaisun2000 commented on a change in pull request #1201:
URL: https://github.com/apache/helix/pull/1201#discussion_r465405655



##########
File path: helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
##########
@@ -1272,7 +1280,7 @@ protected void checkLiveInstancesObservation(List<LiveInstance> liveInstances,
 
   public void shutdown() throws InterruptedException {
     stopPeriodRebalance();
-
+    stopOnDemandTimer();

Review comment:
       I noticed it too. periodicalRebalanceTimer would be canceled in Finalize and created in init time. But this time before did not do this. Maybe it is for a reason. (Not that familiar with P2P) I am afraid changing its life cycle may cause some unexpected behavior. 




----------------------------------------------------------------
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 a change in pull request #1201: Identify and shutdown leaked timer threads

Posted by GitBox <gi...@apache.org>.
jiajunwang commented on a change in pull request #1201:
URL: https://github.com/apache/helix/pull/1201#discussion_r465945311



##########
File path: helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
##########
@@ -357,6 +358,12 @@ void stopPeriodRebalance() {
     }
   }
 
+  private void stopOnDemandTimer() {

Review comment:
       nit, let's call this shutdownOnDemandTimer.
   
   Considering the periodRebalanceTimer can be started and stopped repeatedly. But this shutdownOnDemandTimer will be one-time thing in our logic.




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