{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/51652453","id":51652453,"diff_hunk":"@@ -373,40 +451,25 @@ private[spark] class CoarseMesosSchedulerBackend(\n   override def frameworkMessage(d: SchedulerDriver, e: ExecutorID, s: SlaveID, b: Array[Byte]) {}\n \n   /**\n-   * Called when a slave is lost or a Mesos task finished. Update local view on\n-   * what tasks are running and remove the terminated slave from the list of pending\n-   * slave IDs that we might have asked to be killed. It also notifies the driver\n-   * that an executor was removed.\n+   * Called when a slave is lost or a Mesos task finished. Updates local view on\n+   * what tasks are running. It also notifies the driver that an executor was removed.\n    */\n-  private def executorTerminated(d: SchedulerDriver, slaveId: String, reason: String): Unit = {\n+  private def executorTerminated(d: SchedulerDriver,\n+                                 slaveId: String,\n+                                 taskId: String,\n+                                 reason: String): Unit = {\n     stateLock.synchronized {\n-      if (slaveIdsWithExecutors.contains(slaveId)) {\n-        val slaveIdToTaskId = taskIdToSlaveId.inverse()\n-        if (slaveIdToTaskId.containsKey(slaveId)) {\n-          val taskId: Int = slaveIdToTaskId.get(slaveId)\n-          taskIdToSlaveId.remove(taskId)\n-          removeExecutor(sparkExecutorId(slaveId, taskId.toString), SlaveLost(reason))\n-        }\n-        // TODO: This assumes one Spark executor per Mesos slave,\n-        // which may no longer be true after SPARK-5095\n-        pendingRemovedSlaveIds -= slaveId\n-        slaveIdsWithExecutors -= slaveId\n-      }\n+      removeExecutor(taskId, SlaveLost(reason))\n+      slaves(slaveId).taskIDs.remove(taskId)","path":"core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala","position":424,"original_position":424,"commit_id":"318486ef4302f997f18904437dda1a550e423bb6","original_commit_id":"318486ef4302f997f18904437dda1a550e423bb6","user":{"login":"mgummelt","id":153734,"avatar_url":"https://avatars.githubusercontent.com/u/153734?v=3","gravatar_id":"","url":"https://api.github.com/users/mgummelt","html_url":"https://github.com/mgummelt","followers_url":"https://api.github.com/users/mgummelt/followers","following_url":"https://api.github.com/users/mgummelt/following{/other_user}","gists_url":"https://api.github.com/users/mgummelt/gists{/gist_id}","starred_url":"https://api.github.com/users/mgummelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgummelt/subscriptions","organizations_url":"https://api.github.com/users/mgummelt/orgs","repos_url":"https://api.github.com/users/mgummelt/repos","events_url":"https://api.github.com/users/mgummelt/events{/privacy}","received_events_url":"https://api.github.com/users/mgummelt/received_events","type":"User","site_admin":false},"body":" Are you worried about memory?  Even w/ 1k executors, this should only be ~20k of memory.  I'd prefer to take that tradeoff in order to keep the code as simple as possible.","created_at":"2016-02-02T23:10:43Z","updated_at":"2016-02-02T23:10:43Z","html_url":"https://github.com/apache/spark/pull/10993#discussion_r51652453","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/10993","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/51652453"},"html":{"href":"https://github.com/apache/spark/pull/10993#discussion_r51652453"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/10993"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/10993","id":57719878,"html_url":"https://github.com/apache/spark/pull/10993","diff_url":"https://github.com/apache/spark/pull/10993.diff","patch_url":"https://github.com/apache/spark/pull/10993.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/10993","number":10993,"state":"open","locked":false,"title":"[SPARK-5095] [Mesos] Support launching multiple mesos executors in coarse grained mesos mode.","user":{"login":"mgummelt","id":153734,"avatar_url":"https://avatars.githubusercontent.com/u/153734?v=3","gravatar_id":"","url":"https://api.github.com/users/mgummelt","html_url":"https://github.com/mgummelt","followers_url":"https://api.github.com/users/mgummelt/followers","following_url":"https://api.github.com/users/mgummelt/following{/other_user}","gists_url":"https://api.github.com/users/mgummelt/gists{/gist_id}","starred_url":"https://api.github.com/users/mgummelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgummelt/subscriptions","organizations_url":"https://api.github.com/users/mgummelt/orgs","repos_url":"https://api.github.com/users/mgummelt/repos","events_url":"https://api.github.com/users/mgummelt/events{/privacy}","received_events_url":"https://api.github.com/users/mgummelt/received_events","type":"User","site_admin":false},"body":"This is the next iteration of @tnachen's previous PR: https://github.com/apache/spark/pull/4027\r\n\r\nIn that PR, we resolved with @andrewor14 and @pwendell to implement the Mesos scheduler's support of `spark.executor.cores` to be consistent with YARN and Standalone.  This PR implements that resolution.\r\n\r\nThis PR implements two high-level features.  These two features are co-dependent, so they're implemented both here:\r\n- Mesos support for spark.executor.cores\r\n- Multiple executors per slave\r\n\r\nWe at Mesosphere have been working with Typesafe on a Spark/Mesos integration test suite: https://github.com/typesafehub/mesos-spark-integration-tests, which passes for this PR.\r\n\r\nThe contribution is my original work and I license the work to the project under the project's open source license. \r\n","created_at":"2016-01-30T00:00:02Z","updated_at":"2016-02-02T23:10:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b1ed5b6d7eb94d12b6f90d3239b6737dd1332f67","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/10993/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/10993/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/10993/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/318486ef4302f997f18904437dda1a550e423bb6","head":{"label":"mesosphere:executor_sizing","ref":"executor_sizing","sha":"318486ef4302f997f18904437dda1a550e423bb6","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":34087729,"name":"spark","full_name":"mesosphere/spark","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/mesosphere/spark","forks_url":"https://api.github.com/repos/mesosphere/spark/forks","keys_url":"https://api.github.com/repos/mesosphere/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/spark/teams","hooks_url":"https://api.github.com/repos/mesosphere/spark/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/spark/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/spark/events","assignees_url":"https://api.github.com/repos/mesosphere/spark/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/spark/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/spark/tags","blobs_url":"https://api.github.com/repos/mesosphere/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/spark/languages","stargazers_url":"https://api.github.com/repos/mesosphere/spark/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/spark/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/spark/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/spark/subscription","commits_url":"https://api.github.com/repos/mesosphere/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/spark/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/spark/merges","archive_url":"https://api.github.com/repos/mesosphere/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/spark/downloads","issues_url":"https://api.github.com/repos/mesosphere/spark/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/spark/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/spark/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/spark/deployments","created_at":"2015-04-17T00:19:40Z","updated_at":"2016-01-25T13:12:56Z","pushed_at":"2016-02-02T14:45:37Z","git_url":"git://github.com/mesosphere/spark.git","ssh_url":"git@github.com:mesosphere/spark.git","clone_url":"https://github.com/mesosphere/spark.git","svn_url":"https://github.com/mesosphere/spark","homepage":null,"size":141215,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"be7a2fc0716b7d25327b6f8f683390fc62532e3b","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}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2016-02-02T22:50:20Z","pushed_at":"2016-02-02T23:07:39Z","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":408212,"stargazers_count":7314,"watchers_count":7314,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6658,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":358,"forks":6658,"open_issues":358,"watchers":7314,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/10993"},"html":{"href":"https://github.com/apache/spark/pull/10993"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/10993"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/10993/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/10993/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/10993/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/318486ef4302f997f18904437dda1a550e423bb6"}}}}