{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/7888","labels_url":"https://api.github.com/repos/apache/spark/issues/7888/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/7888/comments","events_url":"https://api.github.com/repos/apache/spark/issues/7888/events","html_url":"https://github.com/apache/spark/pull/7888","id":98682274,"number":7888,"title":"[SPARK-9552] Add force control for killExecutors to avoid false killing for those busy executors","user":{"login":"GraceH","id":1960093,"avatar_url":"https://avatars.githubusercontent.com/u/1960093?v=3","gravatar_id":"","url":"https://api.github.com/users/GraceH","html_url":"https://github.com/GraceH","followers_url":"https://api.github.com/users/GraceH/followers","following_url":"https://api.github.com/users/GraceH/following{/other_user}","gists_url":"https://api.github.com/users/GraceH/gists{/gist_id}","starred_url":"https://api.github.com/users/GraceH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GraceH/subscriptions","organizations_url":"https://api.github.com/users/GraceH/orgs","repos_url":"https://api.github.com/users/GraceH/repos","events_url":"https://api.github.com/users/GraceH/events{/privacy}","received_events_url":"https://api.github.com/users/GraceH/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":41,"created_at":"2015-08-03T06:41:20Z","updated_at":"2015-11-12T13:57:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/7888","html_url":"https://github.com/apache/spark/pull/7888","diff_url":"https://github.com/apache/spark/pull/7888.diff","patch_url":"https://github.com/apache/spark/pull/7888.patch"},"body":"By using the dynamic allocation, sometimes it occurs false killing for those busy executors. Some executors with assignments will be killed because of being idle for enough time (say 60 seconds). The root cause is that the Task-Launch listener event is asynchronized.  \r\n\r\nFor example, some executors are under assigning tasks, but not sending out the listener notification yet. Meanwhile, the dynamic allocation's executor idle time is up (e.g., 60 seconds). It will trigger killExecutor event at the same time. \r\n 1. the timer expiration starts before the listener event arrives.\r\n 2. Then, the task is going to run on top of that killed/killing executor. It will lead to task failure finally. \r\n\r\nHere is the proposal to fix it. We can add the force control for killExecutor. If the force control is not set (i.e., false), we'd better to check if the executor under killing is idle or busy. If the current executor has some assignment, we should not kill that executor and return back false (to indicate killing failure). In dynamic allocation, we'd better to turn off force killing (i.e., force = false), we will meet killing failure if tries to kill a busy executor. And then, the executor timer won't be invalid. Later on, the task assignment event arrives, we can remove the idle timer accordingly. So that we can avoid false killing for those busy executors in dynamic allocation. \r\n\r\nFor the rest of usages, the end users can decide if to use force killing or not by themselves.  If to turn on that option, the killExecutor will do the action without any status checking."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/156108329","html_url":"https://github.com/apache/spark/pull/7888#issuecomment-156108329","issue_url":"https://api.github.com/repos/apache/spark/issues/7888","id":156108329,"user":{"login":"AmplabJenkins","id":4031291,"avatar_url":"https://avatars.githubusercontent.com/u/4031291?v=3","gravatar_id":"","url":"https://api.github.com/users/AmplabJenkins","html_url":"https://github.com/AmplabJenkins","followers_url":"https://api.github.com/users/AmplabJenkins/followers","following_url":"https://api.github.com/users/AmplabJenkins/following{/other_user}","gists_url":"https://api.github.com/users/AmplabJenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/AmplabJenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmplabJenkins/subscriptions","organizations_url":"https://api.github.com/users/AmplabJenkins/orgs","repos_url":"https://api.github.com/users/AmplabJenkins/repos","events_url":"https://api.github.com/users/AmplabJenkins/events{/privacy}","received_events_url":"https://api.github.com/users/AmplabJenkins/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T13:57:18Z","updated_at":"2015-11-12T13:57:18Z","body":"Merged build started."}}