Fix Periodic rebalancer Timer leak#1456
Conversation
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
Outdated
Show resolved
Hide resolved
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
Outdated
Show resolved
Hide resolved
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
Show resolved
Hide resolved
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
Outdated
Show resolved
Hide resolved
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
Outdated
Show resolved
Hide resolved
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
Outdated
Show resolved
Hide resolved
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
Show resolved
Hide resolved
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
Outdated
Show resolved
Hide resolved
|
One more thing I forget to mention before is this: The current leaking is caused that two events are push to TaskRebalance thread and HelixRebalance thread at the same time. All the above is under assumption that periodic rebalance triggering thread (previous timer, now the is shared by task and now _periodicalRebalanceExecutor. Is there a possibility later that we will use two different (timer)? |
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
Outdated
Show resolved
Hide resolved
8f2fd94 to
a0564e9
Compare
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
Outdated
Show resolved
Hide resolved
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
Show resolved
Hide resolved
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
Show resolved
Hide resolved
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
Outdated
Show resolved
Hide resolved
jiajunwang
left a comment
There was a problem hiding this comment.
LGTM
Please ensure the remaining comments are addressed.
|
My PR is ready to be merged in. Approved by @jiajunwang Final commit message: |
Issues
Race condition cause Timer leak in GenericHelixController #1453 Race condition cause Timer leak in GenericHelixController
Description
We found a periodic rebalance's Timer leakage issue during log analysis. In current startPeriodRebalance, two thread may interference with each other. This may result in one timer got canceled twice, two timers are created with one timer leaked.
This PR changes Timer to use a SingleThreadScheduledExecutor and adds a synchronized block in start/stop PeriodRebalance.
Tests
NA
Commits
Documentation (Optional)
(Link the GitHub wiki you added)
Code Quality
(helix-style-intellij.xml if IntelliJ IDE is used)