{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/84785459","pull_request_review_id":5538546,"id":84785459,"diff_hunk":"@@ -710,7 +723,11 @@ object SparkSubmit {\n       printWarning(\"Subclasses of scala.App may not work correctly. Use a main() method instead.\")\n     }\n \n-    val mainMethod = mainClass.getMethod(\"main\", new Array[String](0).getClass)\n+    val mainMethod = if (threadEnabled ) {\n+      mainClass.getMethods().filter(i => i.getName() == \"sparkMain\")(0)\n+    } else {\n+      mainClass.getMethod(\"main\", new Array[String](0).getClass)","path":"core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala","position":41,"original_position":41,"commit_id":"92e444578ba5dfea02f473101999a82fa8c8d325","original_commit_id":"92e444578ba5dfea02f473101999a82fa8c8d325","user":{"login":"vanzin","id":1694083,"avatar_url":"https://avatars.githubusercontent.com/u/1694083?v=3","gravatar_id":"","url":"https://api.github.com/users/vanzin","html_url":"https://github.com/vanzin","followers_url":"https://api.github.com/users/vanzin/followers","following_url":"https://api.github.com/users/vanzin/following{/other_user}","gists_url":"https://api.github.com/users/vanzin/gists{/gist_id}","starred_url":"https://api.github.com/users/vanzin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vanzin/subscriptions","organizations_url":"https://api.github.com/users/vanzin/orgs","repos_url":"https://api.github.com/users/vanzin/repos","events_url":"https://api.github.com/users/vanzin/events{/privacy}","received_events_url":"https://api.github.com/users/vanzin/received_events","type":"User","site_admin":false},"body":"not your fault, but `classOf[Array[String]]`","created_at":"2016-10-24T21:16:04Z","updated_at":"2016-10-24T21:16:18Z","html_url":"https://github.com/apache/spark/pull/15009#discussion_r84785459","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/15009","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/84785459"},"html":{"href":"https://github.com/apache/spark/pull/15009#discussion_r84785459"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/15009"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/15009","id":84409465,"html_url":"https://github.com/apache/spark/pull/15009","diff_url":"https://github.com/apache/spark/pull/15009.diff","patch_url":"https://github.com/apache/spark/pull/15009.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/15009","number":15009,"state":"open","locked":false,"title":"[SPARK-17443][SPARK-11035] Stop Spark Application if launcher goes down and use reflection","user":{"login":"kishorvpatil","id":6090397,"avatar_url":"https://avatars.githubusercontent.com/u/6090397?v=3","gravatar_id":"","url":"https://api.github.com/users/kishorvpatil","html_url":"https://github.com/kishorvpatil","followers_url":"https://api.github.com/users/kishorvpatil/followers","following_url":"https://api.github.com/users/kishorvpatil/following{/other_user}","gists_url":"https://api.github.com/users/kishorvpatil/gists{/gist_id}","starred_url":"https://api.github.com/users/kishorvpatil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kishorvpatil/subscriptions","organizations_url":"https://api.github.com/users/kishorvpatil/orgs","repos_url":"https://api.github.com/users/kishorvpatil/repos","events_url":"https://api.github.com/users/kishorvpatil/events{/privacy}","received_events_url":"https://api.github.com/users/kishorvpatil/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\n1. `SparkLauncher` provides `stopIfInterrupted` method to allow ensuring `SparkApplication` stops if tracking process dies. \r\n2.  `SparkLauncher` provides `startApplicationInProcess` method to start application using reflection in another Thread instead of launching childProcess and relying on `spark-submit` binary.\r\n\r\n(Please fill in changes proposed in this fix)\r\n\r\n\r\n## How was this patch tested?\r\n\r\nI ran following Manual tests:\r\n1. `startApplication` with request to `stopIfInterrupted`, then send interrupt signal to the process.\r\n  Result:  The `childprocess` kills Spark Application and terminates.\r\n2. `startApplicationInProcess`  with request to `stopIfInterrupted`, then send interrupt signal to the process.\r\n  Result:  The shutdownHook in LauncherBackend kills Spark Application and before termination.\r\n3. `startApplication` without `stopIfInterrupted`, then send interrupt signal to the process.\r\n  Result:  The `childprocess` terminates without killing the Spark Application.\r\n4. `startApplicationInProcess` without `stopIfInterrupted`, then send interrupt signal to the process.\r\n  Result:  The process terminates without killing Spark Application.\r\n\r\n","created_at":"2016-09-08T03:34:34Z","updated_at":"2016-10-24T21:52:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59ac1bb8428cc0214f211748ab3aa0004863e67a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/15009/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/15009/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/15009/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/92e444578ba5dfea02f473101999a82fa8c8d325","head":{"label":"kishorvpatil:SPARK-17443","ref":"SPARK-17443","sha":"92e444578ba5dfea02f473101999a82fa8c8d325","user":{"login":"kishorvpatil","id":6090397,"avatar_url":"https://avatars.githubusercontent.com/u/6090397?v=3","gravatar_id":"","url":"https://api.github.com/users/kishorvpatil","html_url":"https://github.com/kishorvpatil","followers_url":"https://api.github.com/users/kishorvpatil/followers","following_url":"https://api.github.com/users/kishorvpatil/following{/other_user}","gists_url":"https://api.github.com/users/kishorvpatil/gists{/gist_id}","starred_url":"https://api.github.com/users/kishorvpatil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kishorvpatil/subscriptions","organizations_url":"https://api.github.com/users/kishorvpatil/orgs","repos_url":"https://api.github.com/users/kishorvpatil/repos","events_url":"https://api.github.com/users/kishorvpatil/events{/privacy}","received_events_url":"https://api.github.com/users/kishorvpatil/received_events","type":"User","site_admin":false},"repo":{"id":59697532,"name":"spark","full_name":"kishorvpatil/spark","owner":{"login":"kishorvpatil","id":6090397,"avatar_url":"https://avatars.githubusercontent.com/u/6090397?v=3","gravatar_id":"","url":"https://api.github.com/users/kishorvpatil","html_url":"https://github.com/kishorvpatil","followers_url":"https://api.github.com/users/kishorvpatil/followers","following_url":"https://api.github.com/users/kishorvpatil/following{/other_user}","gists_url":"https://api.github.com/users/kishorvpatil/gists{/gist_id}","starred_url":"https://api.github.com/users/kishorvpatil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kishorvpatil/subscriptions","organizations_url":"https://api.github.com/users/kishorvpatil/orgs","repos_url":"https://api.github.com/users/kishorvpatil/repos","events_url":"https://api.github.com/users/kishorvpatil/events{/privacy}","received_events_url":"https://api.github.com/users/kishorvpatil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kishorvpatil/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/kishorvpatil/spark","forks_url":"https://api.github.com/repos/kishorvpatil/spark/forks","keys_url":"https://api.github.com/repos/kishorvpatil/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kishorvpatil/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kishorvpatil/spark/teams","hooks_url":"https://api.github.com/repos/kishorvpatil/spark/hooks","issue_events_url":"https://api.github.com/repos/kishorvpatil/spark/issues/events{/number}","events_url":"https://api.github.com/repos/kishorvpatil/spark/events","assignees_url":"https://api.github.com/repos/kishorvpatil/spark/assignees{/user}","branches_url":"https://api.github.com/repos/kishorvpatil/spark/branches{/branch}","tags_url":"https://api.github.com/repos/kishorvpatil/spark/tags","blobs_url":"https://api.github.com/repos/kishorvpatil/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kishorvpatil/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kishorvpatil/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/kishorvpatil/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kishorvpatil/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/kishorvpatil/spark/languages","stargazers_url":"https://api.github.com/repos/kishorvpatil/spark/stargazers","contributors_url":"https://api.github.com/repos/kishorvpatil/spark/contributors","subscribers_url":"https://api.github.com/repos/kishorvpatil/spark/subscribers","subscription_url":"https://api.github.com/repos/kishorvpatil/spark/subscription","commits_url":"https://api.github.com/repos/kishorvpatil/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/kishorvpatil/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/kishorvpatil/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/kishorvpatil/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/kishorvpatil/spark/contents/{+path}","compare_url":"https://api.github.com/repos/kishorvpatil/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kishorvpatil/spark/merges","archive_url":"https://api.github.com/repos/kishorvpatil/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kishorvpatil/spark/downloads","issues_url":"https://api.github.com/repos/kishorvpatil/spark/issues{/number}","pulls_url":"https://api.github.com/repos/kishorvpatil/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/kishorvpatil/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/kishorvpatil/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kishorvpatil/spark/labels{/name}","releases_url":"https://api.github.com/repos/kishorvpatil/spark/releases{/id}","deployments_url":"https://api.github.com/repos/kishorvpatil/spark/deployments","created_at":"2016-05-25T21:03:43Z","updated_at":"2016-05-25T21:04:05Z","pushed_at":"2016-10-20T00:48:29Z","git_url":"git://github.com/kishorvpatil/spark.git","ssh_url":"git@github.com:kishorvpatil/spark.git","clone_url":"https://github.com/kishorvpatil/spark.git","svn_url":"https://github.com/kishorvpatil/spark","homepage":null,"size":234002,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"b230fb92a53375b648fa0f9e1d852270156d79e5","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-10-24T18:39:34Z","pushed_at":"2016-10-24T21:17:31Z","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":602049,"stargazers_count":10479,"watchers_count":10479,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9754,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":485,"forks":9754,"open_issues":485,"watchers":10479,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/15009"},"html":{"href":"https://github.com/apache/spark/pull/15009"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/15009"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/15009/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/15009/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/15009/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/92e444578ba5dfea02f473101999a82fa8c8d325"}}}}
{"actor":{"display_login":"vanzin"}}