{"action":"created","comment":{"url":"https://api.github.com/repos/apache/reef/pulls/comments/92053080","pull_request_review_id":12531175,"id":92053080,"diff_hunk":"@@ -127,10 +133,25 @@ internal sealed class IMRUDriver<TMapInput, TMapOutput, TResult, TPartitionType>\n         private int _numberOfRetries;\n \n         /// <summary>\n+        /// Minimum timeout in milliseconds for TaskWaitingForClose\n+        /// </summary>\n+        private readonly int _minTaskWaitingForCloseTimeout;\n+\n+        /// <summary>\n         /// Manages lifecycle events for driver, like JobCancelled event.\n         /// </summary>\n         private readonly List<IDisposable> _disposableResources = new List<IDisposable>();\n \n+        private Timer _timeputMonitorTimer;\n+\n+        private readonly object _disposeLock = new object();\n+\n+        /// <summary>\n+        /// Record tasks that are closed after timeout. \n+        /// The CompletedTask and failedEvaluator events from those tasks should be ignored to avoid double counted. \n+        /// </summary>\n+        private readonly IList<string> _taskForceClosed = new List<string>();","path":"lang/cs/Org.Apache.REEF.IMRU/OnREEF/Driver/IMRUDriver.cs","position":41,"original_position":41,"commit_id":"321b840b94c3b7fb52fd6e2e8dc05f48990d4188","original_commit_id":"321b840b94c3b7fb52fd6e2e8dc05f48990d4188","user":{"login":"tcNickolas","id":10113024,"avatar_url":"https://avatars.githubusercontent.com/u/10113024?v=3","gravatar_id":"","url":"https://api.github.com/users/tcNickolas","html_url":"https://github.com/tcNickolas","followers_url":"https://api.github.com/users/tcNickolas/followers","following_url":"https://api.github.com/users/tcNickolas/following{/other_user}","gists_url":"https://api.github.com/users/tcNickolas/gists{/gist_id}","starred_url":"https://api.github.com/users/tcNickolas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcNickolas/subscriptions","organizations_url":"https://api.github.com/users/tcNickolas/orgs","repos_url":"https://api.github.com/users/tcNickolas/repos","events_url":"https://api.github.com/users/tcNickolas/events{/privacy}","received_events_url":"https://api.github.com/users/tcNickolas/received_events","type":"User","site_admin":false},"body":"We're not actually closing the tasks, we're killing underlying evaluators. Would it make sense to keep a list of killed evaluators, so that any event that comes from any of these evaluators is ignored? I suspect this will be handy later when we're implementing timeouts for other events, since in all cases our reaction will be to kill evaluator, not the task","created_at":"2016-12-12T22:14:49Z","updated_at":"2016-12-12T22:16:40Z","html_url":"https://github.com/apache/reef/pull/1201#discussion_r92053080","pull_request_url":"https://api.github.com/repos/apache/reef/pulls/1201","_links":{"self":{"href":"https://api.github.com/repos/apache/reef/pulls/comments/92053080"},"html":{"href":"https://github.com/apache/reef/pull/1201#discussion_r92053080"},"pull_request":{"href":"https://api.github.com/repos/apache/reef/pulls/1201"}}},"pull_request":{"url":"https://api.github.com/repos/apache/reef/pulls/1201","id":97219473,"html_url":"https://github.com/apache/reef/pull/1201","diff_url":"https://github.com/apache/reef/pull/1201.diff","patch_url":"https://github.com/apache/reef/pull/1201.patch","issue_url":"https://api.github.com/repos/apache/reef/issues/1201","number":1201,"state":"open","locked":false,"title":"[REEF-1511] Timeout for Task shutdown during IMRU recovery","user":{"login":"jwang98052","id":5666504,"avatar_url":"https://avatars.githubusercontent.com/u/5666504?v=3","gravatar_id":"","url":"https://api.github.com/users/jwang98052","html_url":"https://github.com/jwang98052","followers_url":"https://api.github.com/users/jwang98052/followers","following_url":"https://api.github.com/users/jwang98052/following{/other_user}","gists_url":"https://api.github.com/users/jwang98052/gists{/gist_id}","starred_url":"https://api.github.com/users/jwang98052/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwang98052/subscriptions","organizations_url":"https://api.github.com/users/jwang98052/orgs","repos_url":"https://api.github.com/users/jwang98052/repos","events_url":"https://api.github.com/users/jwang98052/events{/privacy}","received_events_url":"https://api.github.com/users/jwang98052/received_events","type":"User","site_admin":false},"body":"During IMRU FT recovery, sometimes the tasks that supposed to close by driver don't send completed event back, causing the system hang. This PR adds the timeout for tasks closed by driver, and kill the evaluator if timeout.\r\n\r\nThe average closing time is recorded in the TaskManager. This number is a reference for define the time out on the fly. In case the average number is accessed before the average data is accumulated, or the average number is too low in some scenarios, we also have a configurable MinTaskWaitingForCloseTimeout to ensure the driver wait for enough time before killing the evaluator.\r\n\r\nJIRA: [REEF-1511](https://issues.apache.org/jira/browse/REEF-1511)\r\nThis closes  #","created_at":"2016-12-08T23:10:00Z","updated_at":"2016-12-12T22:16:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d55239216df0a5ab8964b4b88d18d54fdb5b7875","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/reef/pulls/1201/commits","review_comments_url":"https://api.github.com/repos/apache/reef/pulls/1201/comments","review_comment_url":"https://api.github.com/repos/apache/reef/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/reef/issues/1201/comments","statuses_url":"https://api.github.com/repos/apache/reef/statuses/321b840b94c3b7fb52fd6e2e8dc05f48990d4188","head":{"label":"jwang98052:REEF-1511","ref":"REEF-1511","sha":"321b840b94c3b7fb52fd6e2e8dc05f48990d4188","user":{"login":"jwang98052","id":5666504,"avatar_url":"https://avatars.githubusercontent.com/u/5666504?v=3","gravatar_id":"","url":"https://api.github.com/users/jwang98052","html_url":"https://github.com/jwang98052","followers_url":"https://api.github.com/users/jwang98052/followers","following_url":"https://api.github.com/users/jwang98052/following{/other_user}","gists_url":"https://api.github.com/users/jwang98052/gists{/gist_id}","starred_url":"https://api.github.com/users/jwang98052/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwang98052/subscriptions","organizations_url":"https://api.github.com/users/jwang98052/orgs","repos_url":"https://api.github.com/users/jwang98052/repos","events_url":"https://api.github.com/users/jwang98052/events{/privacy}","received_events_url":"https://api.github.com/users/jwang98052/received_events","type":"User","site_admin":false},"repo":{"id":25940156,"name":"reef","full_name":"jwang98052/reef","owner":{"login":"jwang98052","id":5666504,"avatar_url":"https://avatars.githubusercontent.com/u/5666504?v=3","gravatar_id":"","url":"https://api.github.com/users/jwang98052","html_url":"https://github.com/jwang98052","followers_url":"https://api.github.com/users/jwang98052/followers","following_url":"https://api.github.com/users/jwang98052/following{/other_user}","gists_url":"https://api.github.com/users/jwang98052/gists{/gist_id}","starred_url":"https://api.github.com/users/jwang98052/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwang98052/subscriptions","organizations_url":"https://api.github.com/users/jwang98052/orgs","repos_url":"https://api.github.com/users/jwang98052/repos","events_url":"https://api.github.com/users/jwang98052/events{/privacy}","received_events_url":"https://api.github.com/users/jwang98052/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jwang98052/reef","description":"Mirror of Apache REEF (Incubating)","fork":true,"url":"https://api.github.com/repos/jwang98052/reef","forks_url":"https://api.github.com/repos/jwang98052/reef/forks","keys_url":"https://api.github.com/repos/jwang98052/reef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jwang98052/reef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jwang98052/reef/teams","hooks_url":"https://api.github.com/repos/jwang98052/reef/hooks","issue_events_url":"https://api.github.com/repos/jwang98052/reef/issues/events{/number}","events_url":"https://api.github.com/repos/jwang98052/reef/events","assignees_url":"https://api.github.com/repos/jwang98052/reef/assignees{/user}","branches_url":"https://api.github.com/repos/jwang98052/reef/branches{/branch}","tags_url":"https://api.github.com/repos/jwang98052/reef/tags","blobs_url":"https://api.github.com/repos/jwang98052/reef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jwang98052/reef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jwang98052/reef/git/refs{/sha}","trees_url":"https://api.github.com/repos/jwang98052/reef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jwang98052/reef/statuses/{sha}","languages_url":"https://api.github.com/repos/jwang98052/reef/languages","stargazers_url":"https://api.github.com/repos/jwang98052/reef/stargazers","contributors_url":"https://api.github.com/repos/jwang98052/reef/contributors","subscribers_url":"https://api.github.com/repos/jwang98052/reef/subscribers","subscription_url":"https://api.github.com/repos/jwang98052/reef/subscription","commits_url":"https://api.github.com/repos/jwang98052/reef/commits{/sha}","git_commits_url":"https://api.github.com/repos/jwang98052/reef/git/commits{/sha}","comments_url":"https://api.github.com/repos/jwang98052/reef/comments{/number}","issue_comment_url":"https://api.github.com/repos/jwang98052/reef/issues/comments{/number}","contents_url":"https://api.github.com/repos/jwang98052/reef/contents/{+path}","compare_url":"https://api.github.com/repos/jwang98052/reef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jwang98052/reef/merges","archive_url":"https://api.github.com/repos/jwang98052/reef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jwang98052/reef/downloads","issues_url":"https://api.github.com/repos/jwang98052/reef/issues{/number}","pulls_url":"https://api.github.com/repos/jwang98052/reef/pulls{/number}","milestones_url":"https://api.github.com/repos/jwang98052/reef/milestones{/number}","notifications_url":"https://api.github.com/repos/jwang98052/reef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jwang98052/reef/labels{/name}","releases_url":"https://api.github.com/repos/jwang98052/reef/releases{/id}","deployments_url":"https://api.github.com/repos/jwang98052/reef/deployments","created_at":"2014-10-29T20:32:40Z","updated_at":"2016-06-01T23:24:31Z","pushed_at":"2016-12-12T20:46:12Z","git_url":"git://github.com/jwang98052/reef.git","ssh_url":"git@github.com:jwang98052/reef.git","clone_url":"https://github.com/jwang98052/reef.git","svn_url":"https://github.com/jwang98052/reef","homepage":null,"size":40435,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"eb66b2e9d473418b8df9415b26809016c526114a","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":25623941,"name":"reef","full_name":"apache/reef","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/reef","description":"Mirror of Apache REEF","fork":false,"url":"https://api.github.com/repos/apache/reef","forks_url":"https://api.github.com/repos/apache/reef/forks","keys_url":"https://api.github.com/repos/apache/reef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/reef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/reef/teams","hooks_url":"https://api.github.com/repos/apache/reef/hooks","issue_events_url":"https://api.github.com/repos/apache/reef/issues/events{/number}","events_url":"https://api.github.com/repos/apache/reef/events","assignees_url":"https://api.github.com/repos/apache/reef/assignees{/user}","branches_url":"https://api.github.com/repos/apache/reef/branches{/branch}","tags_url":"https://api.github.com/repos/apache/reef/tags","blobs_url":"https://api.github.com/repos/apache/reef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/reef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/reef/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/reef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/reef/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/reef/languages","stargazers_url":"https://api.github.com/repos/apache/reef/stargazers","contributors_url":"https://api.github.com/repos/apache/reef/contributors","subscribers_url":"https://api.github.com/repos/apache/reef/subscribers","subscription_url":"https://api.github.com/repos/apache/reef/subscription","commits_url":"https://api.github.com/repos/apache/reef/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/reef/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/reef/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/reef/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/reef/contents/{+path}","compare_url":"https://api.github.com/repos/apache/reef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/reef/merges","archive_url":"https://api.github.com/repos/apache/reef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/reef/downloads","issues_url":"https://api.github.com/repos/apache/reef/issues{/number}","pulls_url":"https://api.github.com/repos/apache/reef/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/reef/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/reef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/reef/labels{/name}","releases_url":"https://api.github.com/repos/apache/reef/releases{/id}","deployments_url":"https://api.github.com/repos/apache/reef/deployments","created_at":"2014-10-23T07:00:10Z","updated_at":"2016-11-11T18:26:45Z","pushed_at":"2016-12-12T20:46:40Z","git_url":"git://github.com/apache/reef.git","ssh_url":"git@github.com:apache/reef.git","clone_url":"https://github.com/apache/reef.git","svn_url":"https://github.com/apache/reef","homepage":"","size":51989,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":72,"mirror_url":"git://git.apache.org/reef.git","open_issues_count":8,"forks":72,"open_issues":8,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/reef/pulls/1201"},"html":{"href":"https://github.com/apache/reef/pull/1201"},"issue":{"href":"https://api.github.com/repos/apache/reef/issues/1201"},"comments":{"href":"https://api.github.com/repos/apache/reef/issues/1201/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/reef/pulls/1201/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/reef/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/reef/pulls/1201/commits"},"statuses":{"href":"https://api.github.com/repos/apache/reef/statuses/321b840b94c3b7fb52fd6e2e8dc05f48990d4188"}}}}
{"actor":{"display_login":"tcNickolas"}}