{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/37794215","id":37794215,"diff_hunk":"@@ -213,8 +216,11 @@ private[yarn] class YarnAllocator(\n    * Deal with any containers YARN has granted to us by possibly launching executors in them.\n    *\n    * This must be synchronized because variables read in this method are mutated by other methods.\n+   *\n+   * Returns a list of executor loss reasons discovered by the allocator, which can then be forwarded\n+   * to the driver by the calling ApplicationMaster.\n    */\n-  def allocateResources(): Unit = synchronized {\n+  def allocateResources(): Option[Map[String, ExecutorLossReason]] = synchronized {","path":"yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala","position":35,"original_position":35,"commit_id":"22fbe2a9ce720968eee00f8a26a651cf667c6d72","original_commit_id":"22fbe2a9ce720968eee00f8a26a651cf667c6d72","user":{"login":"mccheah","id":8975385,"avatar_url":"https://avatars.githubusercontent.com/u/8975385?v=3","gravatar_id":"","url":"https://api.github.com/users/mccheah","html_url":"https://github.com/mccheah","followers_url":"https://api.github.com/users/mccheah/followers","following_url":"https://api.github.com/users/mccheah/following{/other_user}","gists_url":"https://api.github.com/users/mccheah/gists{/gist_id}","starred_url":"https://api.github.com/users/mccheah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mccheah/subscriptions","organizations_url":"https://api.github.com/users/mccheah/orgs","repos_url":"https://api.github.com/users/mccheah/repos","events_url":"https://api.github.com/users/mccheah/events{/privacy}","received_events_url":"https://api.github.com/users/mccheah/received_events","type":"User","site_admin":false},"body":"Yup","created_at":"2015-08-24T19:36:45Z","updated_at":"2015-08-24T19:36:45Z","html_url":"https://github.com/apache/spark/pull/8007#discussion_r37794215","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/8007","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/37794215"},"html":{"href":"https://github.com/apache/spark/pull/8007#discussion_r37794215"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/8007"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/8007","id":41840319,"html_url":"https://github.com/apache/spark/pull/8007","diff_url":"https://github.com/apache/spark/pull/8007.diff","patch_url":"https://github.com/apache/spark/pull/8007.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/8007","number":8007,"state":"open","locked":false,"title":"[SPARK-8167] Make tasks that fail from YARN preemption not fail job","user":{"login":"mccheah","id":8975385,"avatar_url":"https://avatars.githubusercontent.com/u/8975385?v=3","gravatar_id":"","url":"https://api.github.com/users/mccheah","html_url":"https://github.com/mccheah","followers_url":"https://api.github.com/users/mccheah/followers","following_url":"https://api.github.com/users/mccheah/following{/other_user}","gists_url":"https://api.github.com/users/mccheah/gists{/gist_id}","starred_url":"https://api.github.com/users/mccheah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mccheah/subscriptions","organizations_url":"https://api.github.com/users/mccheah/orgs","repos_url":"https://api.github.com/users/mccheah/repos","events_url":"https://api.github.com/users/mccheah/events{/privacy}","received_events_url":"https://api.github.com/users/mccheah/received_events","type":"User","site_admin":false},"body":"The architecture is that, in YARN mode, if the driver detects that an executor has disconnected, it asks the ApplicationMaster why the executor died. If the ApplicationMaster is aware that the executor died because of preemption, all tasks associated with that executor are not marked as failed. The executor\r\nis still removed from the driver's list of available executors, however.\r\n\r\nThere's a few open questions:\r\n1. Should standalone mode have a similar \"get executor loss reason\" as well? I localized this change as much as possible to affect only YARN, but there could be a valid case to differentiate executor losses in standalone mode as well.\r\n2. I make a pretty strong assumption in YarnAllocator that getExecutorLossReason(executorId) will only be called once per executor id; I do this so that I can remove the metadata from the in-memory map to avoid object accumulation. It's not clear if I'm being overly zealous to save space, however.\r\n\r\ncc @vanzin specifically for review because it collided with some earlier YARN scheduling work.\r\ncc @JoshRosen because it's similar to output commit coordination we did in the past\r\ncc @andrewor14 for our discussion on how to get executor exit codes and loss reasons","created_at":"2015-08-06T22:03:35Z","updated_at":"2015-08-24T19:36:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1387de63ad5f45a5fa58771789e4a632647b5d1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/8007/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/8007/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/8007/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/22fbe2a9ce720968eee00f8a26a651cf667c6d72","head":{"label":"palantir:feature/preemption-handling","ref":"feature/preemption-handling","sha":"22fbe2a9ce720968eee00f8a26a651cf667c6d72","user":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"repo":{"id":30919203,"name":"spark","full_name":"palantir/spark","owner":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/palantir/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/palantir/spark","forks_url":"https://api.github.com/repos/palantir/spark/forks","keys_url":"https://api.github.com/repos/palantir/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/palantir/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/palantir/spark/teams","hooks_url":"https://api.github.com/repos/palantir/spark/hooks","issue_events_url":"https://api.github.com/repos/palantir/spark/issues/events{/number}","events_url":"https://api.github.com/repos/palantir/spark/events","assignees_url":"https://api.github.com/repos/palantir/spark/assignees{/user}","branches_url":"https://api.github.com/repos/palantir/spark/branches{/branch}","tags_url":"https://api.github.com/repos/palantir/spark/tags","blobs_url":"https://api.github.com/repos/palantir/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/palantir/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/palantir/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/palantir/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/palantir/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/palantir/spark/languages","stargazers_url":"https://api.github.com/repos/palantir/spark/stargazers","contributors_url":"https://api.github.com/repos/palantir/spark/contributors","subscribers_url":"https://api.github.com/repos/palantir/spark/subscribers","subscription_url":"https://api.github.com/repos/palantir/spark/subscription","commits_url":"https://api.github.com/repos/palantir/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/palantir/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/palantir/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/palantir/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/palantir/spark/contents/{+path}","compare_url":"https://api.github.com/repos/palantir/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/palantir/spark/merges","archive_url":"https://api.github.com/repos/palantir/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/palantir/spark/downloads","issues_url":"https://api.github.com/repos/palantir/spark/issues{/number}","pulls_url":"https://api.github.com/repos/palantir/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/palantir/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/palantir/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/palantir/spark/labels{/name}","releases_url":"https://api.github.com/repos/palantir/spark/releases{/id}","created_at":"2015-02-17T13:57:35Z","updated_at":"2015-07-22T21:57:33Z","pushed_at":"2015-08-22T00:25:20Z","git_url":"git://github.com/palantir/spark.git","ssh_url":"git@github.com:palantir/spark.git","clone_url":"https://github.com/palantir/spark.git","svn_url":"https://github.com/palantir/spark","homepage":null,"size":120865,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":5,"forks":3,"open_issues":5,"watchers":2,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"6c5858bc65c8a8602422b46bfa9cf0a1fb296b88","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":17165658,"name":"spark","full_name":"apache/spark","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/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","created_at":"2014-02-25T08:00:08Z","updated_at":"2015-08-24T16:15:45Z","pushed_at":"2015-08-24T19:34:53Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":1652793,"stargazers_count":5170,"watchers_count":5170,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4740,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":362,"forks":4740,"open_issues":362,"watchers":5170,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/8007"},"html":{"href":"https://github.com/apache/spark/pull/8007"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/8007"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/8007/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/8007/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/8007/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/22fbe2a9ce720968eee00f8a26a651cf667c6d72"}}}}