GitHub user lei-xia opened a pull request: https://github.com/apache/helix/pull/38
[HELIX-613] Fix thread leaking problems in TaskStateModel. Current TaskStateModel creates a thread-pool containing 40 threads for each instance of TaskStateModel, thus it creates 40 threads for each task (partition). Since Job are dynamic resources, the thread pool is not properly shutdown when task has completed (or timeouted, failed, etc). We saw ~10000 threads were created in our production machines. Also, the timeout timer in each TaskStateModel is not properly cancelled even though the task has completed or failed. The timer consume a thread even though it is not used anymore. The proposed solution is to use a shared thread pool for all TaskStateModels created from the same TaskStateModelFactory for all regular tasks and timeout tasks. You can merge this pull request into a Git repository by running: $ git pull https://github.com/lei-xia/helix helix-0.6.x Alternatively you can review and apply these changes as the patch at: https://github.com/apache/helix/pull/38.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #38 ---- commit 456ddb0c4a900ee7cdf081777eff9445378df513 Author: Lei Xia <l...@linkedin.com> Date: 2015-11-08T06:43:04Z [HELIX-613] Fix thread leaking problems in TaskStateModel by sharing one thread pool among all tasks and timeout tasks from TaskStateModels created from the same TaskStateModelFactory. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---