{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/5835","labels_url":"https://api.github.com/repos/apache/spark/issues/5835/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/5835/comments","events_url":"https://api.github.com/repos/apache/spark/issues/5835/events","html_url":"https://github.com/apache/spark/pull/5835","id":72393548,"number":5835,"title":"[SPARK-7233][CORE] Detect REPL mode once","user":{"login":"preeze","id":5769807,"avatar_url":"https://avatars.githubusercontent.com/u/5769807?v=3","gravatar_id":"","url":"https://api.github.com/users/preeze","html_url":"https://github.com/preeze","followers_url":"https://api.github.com/users/preeze/followers","following_url":"https://api.github.com/users/preeze/following{/other_user}","gists_url":"https://api.github.com/users/preeze/gists{/gist_id}","starred_url":"https://api.github.com/users/preeze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/preeze/subscriptions","organizations_url":"https://api.github.com/users/preeze/orgs","repos_url":"https://api.github.com/users/preeze/repos","events_url":"https://api.github.com/users/preeze/events{/privacy}","received_events_url":"https://api.github.com/users/preeze/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-01T09:34:10Z","updated_at":"2015-05-01T09:37:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/5835","html_url":"https://github.com/apache/spark/pull/5835","diff_url":"https://github.com/apache/spark/pull/5835.diff","patch_url":"https://github.com/apache/spark/pull/5835.patch"},"body":"<h3>Description</h3>\r\nDetect REPL mode once per JVM lifespan.\r\nPrevious behavior was to check presence of interpreter mode every time a job was submitted. In the case of execution of multiple short-living jobs this was causing massive mutual blocks between submission threads.\r\n\r\nFor more details please refer to https://issues.apache.org/jira/browse/SPARK-7233.\r\n\r\n<h3>Notes</h3>\r\n* I inverted the return value in case of catching an exception from `true` to `false`. It seems more logical to assume that if the REPL class is not found, we aren't in the interpreter mode.\r\n* I'd personally would call `classForName` with just a Spark classloader (`org.apache.spark.util.Utils#getSparkClassLoader`) but `org.apache.spark.util.Utils#getContextOrSparkClassLoader` is said to be preferable.\r\n* I struggled to come up with a concise, readable and clear unit test. Suggestions are welcome if you feel necessary.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/98085701","html_url":"https://github.com/apache/spark/pull/5835#issuecomment-98085701","issue_url":"https://api.github.com/repos/apache/spark/issues/5835","id":98085701,"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-05-01T09:37:09Z","updated_at":"2015-05-01T09:37:09Z","body":"Can one of the admins verify this patch?"}}