{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/10319","labels_url":"https://api.github.com/repos/apache/spark/issues/10319/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/10319/comments","events_url":"https://api.github.com/repos/apache/spark/issues/10319/events","html_url":"https://github.com/apache/spark/pull/10319","id":122396664,"number":10319,"title":"[SPARK-12330] [MESOS] Fix mesos coarse mode cleanup","user":{"login":"drcrallen","id":8213081,"avatar_url":"https://avatars.githubusercontent.com/u/8213081?v=3","gravatar_id":"","url":"https://api.github.com/users/drcrallen","html_url":"https://github.com/drcrallen","followers_url":"https://api.github.com/users/drcrallen/followers","following_url":"https://api.github.com/users/drcrallen/following{/other_user}","gists_url":"https://api.github.com/users/drcrallen/gists{/gist_id}","starred_url":"https://api.github.com/users/drcrallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drcrallen/subscriptions","organizations_url":"https://api.github.com/users/drcrallen/orgs","repos_url":"https://api.github.com/users/drcrallen/repos","events_url":"https://api.github.com/users/drcrallen/events{/privacy}","received_events_url":"https://api.github.com/users/drcrallen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-12-16T00:02:22Z","updated_at":"2015-12-18T19:24:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/10319","html_url":"https://github.com/apache/spark/pull/10319","diff_url":"https://github.com/apache/spark/pull/10319.diff","patch_url":"https://github.com/apache/spark/pull/10319.patch"},"body":"In the current implementation the mesos coarse scheduler does not wait for the mesos tasks to complete before ending the driver. This causes a race where the task has to finish cleaning up before the mesos driver terminates it with a SIGINT (and SIGKILL after 3 seconds if the SIGINT doesn't work).\r\n\r\nThis PR causes the mesos coarse scheduler to wait for the mesos tasks to finish (with a timeout defined by `spark.mesos.coarse.shutdown.ms`)\r\n\r\nThis PR also fixes a regression caused by [SPARK-10987] whereby submitting a shutdown causes a race between the local shutdown procedure and the notification of the scheduler driver disconnection. If the scheduler driver disconnection wins the race, the coarse executor incorrectly exits with status 1 (instead of the proper status 0)\r\n\r\nWith this patch the mesos coarse scheduler terminates properly, the executors clean up, and the tasks are reported as `FINISHED` in the Mesos console (as opposed to `KILLED` in < 1.6 or `FAILED` in 1.6 and later)"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/165876163","html_url":"https://github.com/apache/spark/pull/10319#issuecomment-165876163","issue_url":"https://api.github.com/repos/apache/spark/issues/10319","id":165876163,"user":{"login":"SparkQA","id":8108735,"avatar_url":"https://avatars.githubusercontent.com/u/8108735?v=3","gravatar_id":"","url":"https://api.github.com/users/SparkQA","html_url":"https://github.com/SparkQA","followers_url":"https://api.github.com/users/SparkQA/followers","following_url":"https://api.github.com/users/SparkQA/following{/other_user}","gists_url":"https://api.github.com/users/SparkQA/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkQA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkQA/subscriptions","organizations_url":"https://api.github.com/users/SparkQA/orgs","repos_url":"https://api.github.com/users/SparkQA/repos","events_url":"https://api.github.com/users/SparkQA/events{/privacy}","received_events_url":"https://api.github.com/users/SparkQA/received_events","type":"User","site_admin":false},"created_at":"2015-12-18T19:24:10Z","updated_at":"2015-12-18T19:24:10Z","body":"**[Test build #48013 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48013/consoleFull)** for PR 10319 at commit [`97de2f1`](https://github.com/apache/spark/commit/97de2f16eb5a8415db9257a538d5d540982a9c8a).\n * This patch passes all tests.\n * This patch merges cleanly.\n * This patch adds no public classes."}}