You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by andrewor14 <gi...@git.apache.org> on 2014/11/11 23:08:34 UTC
[GitHub] spark pull request: [Test] Better exception message from SparkSubm...
GitHub user andrewor14 opened a pull request:
https://github.com/apache/spark/pull/3212
[Test] Better exception message from SparkSubmitSuite
Before:
```
Exception in thread "main" java.lang.Exception: Could not load user defined classes inside of executors
at org.apache.spark.deploy.JarCreationTest$.main(SparkSubmitSuite.scala:471)
at org.apache.spark.deploy.JarCreationTest.main(SparkSubmitSuite.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
```
After:
```
Exception in thread "main" java.lang.Exception: Could not load user class from jar:
java.lang.UnsupportedClassVersionError: SparkSubmitClassA : Unsupported major.minor version 51.0
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:643)
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/andrewor14/spark submit-suite-message
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/3212.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3212
----
commit 8fe6719bfbf74966d7b244662931c377fd98585a
Author: Andrew Or <an...@databricks.com>
Date: 2014-11-11T21:52:55Z
Better exception message from failed test
commit 77792486c818e05286de0d69ffba524274e094ae
Author: Andrew Or <an...@databricks.com>
Date: 2014-11-11T22:00:57Z
Format exception
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [Test] Better exception message from SparkSubm...
Posted by liyezhang556520 <gi...@git.apache.org>.
Github user liyezhang556520 commented on a diff in the pull request:
https://github.com/apache/spark/pull/3212#discussion_r20199515
--- Diff: core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala ---
@@ -451,24 +451,25 @@ class SparkSubmitSuite extends FunSuite with Matchers {
}
}
-object JarCreationTest {
+object JarCreationTest extends Logging {
def main(args: Array[String]) {
Utils.configTestLog4j("INFO")
val conf = new SparkConf()
val sc = new SparkContext(conf)
val result = sc.makeRDD(1 to 100, 10).mapPartitions { x =>
- var foundClasses = false
+ var exception: String = null
try {
Class.forName("SparkSubmitClassA", true, Thread.currentThread().getContextClassLoader)
Class.forName("SparkSubmitClassA", true, Thread.currentThread().getContextClassLoader)
- foundClasses = true
} catch {
- case _: Throwable => // catch all
+ case t: Throwable =>
+ exception = t + "\n" + t.getStackTraceString
+ exception = exception.replaceAll("\n", "\n\t")
}
- Seq(foundClasses).iterator
+ Option(exception).toSeq.iterator
}.collect()
- if (result.contains(false)) {
- throw new Exception("Could not load user defined classes inside of executors")
+ if (result.nonEmpty) {
+ throw new Exception("Could not load user class from jar:\n" + result(0))
--- End diff --
Hi @andrewor14 , only show one class not found? Is it better to show all classes not found when there are more than one?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [Test] Better exception message from SparkSubm...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/3212#issuecomment-62642365
[Test build #23224 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/23224/consoleFull) for PR 3212 at commit [`7779248`](https://github.com/apache/spark/commit/77792486c818e05286de0d69ffba524274e094ae).
* This patch **passes all tests**.
* This patch merges cleanly.
* This patch adds the following public classes _(experimental)_:
* ` throw new Exception("Could not load user class from jar:
" + result(0))`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [Test] Better exception message from SparkSubm...
Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/3212#discussion_r20202502
--- Diff: core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala ---
@@ -451,24 +451,25 @@ class SparkSubmitSuite extends FunSuite with Matchers {
}
}
-object JarCreationTest {
+object JarCreationTest extends Logging {
def main(args: Array[String]) {
Utils.configTestLog4j("INFO")
val conf = new SparkConf()
val sc = new SparkContext(conf)
val result = sc.makeRDD(1 to 100, 10).mapPartitions { x =>
- var foundClasses = false
+ var exception: String = null
try {
Class.forName("SparkSubmitClassA", true, Thread.currentThread().getContextClassLoader)
Class.forName("SparkSubmitClassA", true, Thread.currentThread().getContextClassLoader)
- foundClasses = true
} catch {
- case _: Throwable => // catch all
+ case t: Throwable =>
+ exception = t + "\n" + t.getStackTraceString
+ exception = exception.replaceAll("\n", "\n\t")
}
- Seq(foundClasses).iterator
+ Option(exception).toSeq.iterator
}.collect()
- if (result.contains(false)) {
- throw new Exception("Could not load user defined classes inside of executors")
+ if (result.nonEmpty) {
+ throw new Exception("Could not load user class from jar:\n" + result(0))
--- End diff --
This runs in local mode so we only have one executor anyway.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [Test] Better exception message from SparkSubm...
Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:
https://github.com/apache/spark/pull/3212#issuecomment-62798642
Merging into master and 1.2
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [Test] Better exception message from SparkSubm...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/3212
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [Test] Better exception message from SparkSubm...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/3212#issuecomment-62642372
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/23224/
Test PASSed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [Test] Better exception message from SparkSubm...
Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/3212#discussion_r20202521
--- Diff: core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala ---
@@ -451,24 +451,25 @@ class SparkSubmitSuite extends FunSuite with Matchers {
}
}
-object JarCreationTest {
+object JarCreationTest extends Logging {
def main(args: Array[String]) {
Utils.configTestLog4j("INFO")
val conf = new SparkConf()
val sc = new SparkContext(conf)
val result = sc.makeRDD(1 to 100, 10).mapPartitions { x =>
- var foundClasses = false
+ var exception: String = null
try {
Class.forName("SparkSubmitClassA", true, Thread.currentThread().getContextClassLoader)
Class.forName("SparkSubmitClassA", true, Thread.currentThread().getContextClassLoader)
- foundClasses = true
} catch {
- case _: Throwable => // catch all
+ case t: Throwable =>
+ exception = t + "\n" + t.getStackTraceString
+ exception = exception.replaceAll("\n", "\n\t")
}
- Seq(foundClasses).iterator
+ Option(exception).toSeq.iterator
}.collect()
- if (result.contains(false)) {
- throw new Exception("Could not load user defined classes inside of executors")
+ if (result.nonEmpty) {
+ throw new Exception("Could not load user class from jar:\n" + result(0))
--- End diff --
The exception is likely the same anyway. It'll be very verbose if we include all of them.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [Test] Better exception message from SparkSubm...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/3212#issuecomment-62631819
[Test build #23224 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/23224/consoleFull) for PR 3212 at commit [`7779248`](https://github.com/apache/spark/commit/77792486c818e05286de0d69ffba524274e094ae).
* This patch merges cleanly.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [Test] Better exception message from SparkSubm...
Posted by liyezhang556520 <gi...@git.apache.org>.
Github user liyezhang556520 commented on a diff in the pull request:
https://github.com/apache/spark/pull/3212#discussion_r20202634
--- Diff: core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala ---
@@ -451,24 +451,25 @@ class SparkSubmitSuite extends FunSuite with Matchers {
}
}
-object JarCreationTest {
+object JarCreationTest extends Logging {
def main(args: Array[String]) {
Utils.configTestLog4j("INFO")
val conf = new SparkConf()
val sc = new SparkContext(conf)
val result = sc.makeRDD(1 to 100, 10).mapPartitions { x =>
- var foundClasses = false
+ var exception: String = null
try {
Class.forName("SparkSubmitClassA", true, Thread.currentThread().getContextClassLoader)
Class.forName("SparkSubmitClassA", true, Thread.currentThread().getContextClassLoader)
- foundClasses = true
} catch {
- case _: Throwable => // catch all
+ case t: Throwable =>
+ exception = t + "\n" + t.getStackTraceString
+ exception = exception.replaceAll("\n", "\n\t")
}
- Seq(foundClasses).iterator
+ Option(exception).toSeq.iterator
}.collect()
- if (result.contains(false)) {
- throw new Exception("Could not load user defined classes inside of executors")
+ if (result.nonEmpty) {
+ throw new Exception("Could not load user class from jar:\n" + result(0))
--- End diff --
Yeah, the two classes are the same, I missed that :(
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org