[ https://issues.apache.org/jira/browse/HELIX-613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14995539#comment-14995539 ]
ASF GitHub Bot commented on HELIX-613: -------------------------------------- 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. ---- > TaskStateModel generates significant amount of threads and causing thread > leaking problem > ----------------------------------------------------------------------------------------- > > Key: HELIX-613 > URL: https://issues.apache.org/jira/browse/HELIX-613 > Project: Apache Helix > Issue Type: Bug > Affects Versions: 0.6.x > Reporter: Lei Xia > Assignee: Lei Xia > > 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 TaskStateModel > in a single TaskStateModelFactory for all regular tasks and timeout task. -- This message was sent by Atlassian JIRA (v6.3.4#6332)