Skip to content
Snippets Groups Projects
Commit 1d767967 authored by Sandy Ryza's avatar Sandy Ryza Committed by Thomas Graves
Browse files

SPARK-3014. Log a more informative messages in a couple failure scenario...

...s

Author: Sandy Ryza <sandy@cloudera.com>

Closes #1934 from sryza/sandy-spark-3014 and squashes the following commits:

ae19cc1 [Sandy Ryza] SPARK-3014. Log a more informative messages in a couple failure scenarios
parent 15a56459
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
package org.apache.spark.deploy package org.apache.spark.deploy
import java.io.{File, PrintStream} import java.io.{File, PrintStream}
import java.lang.reflect.InvocationTargetException import java.lang.reflect.{Modifier, InvocationTargetException}
import java.net.URL import java.net.URL
import scala.collection.mutable.{ArrayBuffer, HashMap, Map} import scala.collection.mutable.{ArrayBuffer, HashMap, Map}
...@@ -323,7 +323,9 @@ object SparkSubmit { ...@@ -323,7 +323,9 @@ object SparkSubmit {
} }
val mainMethod = mainClass.getMethod("main", new Array[String](0).getClass) val mainMethod = mainClass.getMethod("main", new Array[String](0).getClass)
if (!Modifier.isStatic(mainMethod.getModifiers)) {
throw new IllegalStateException("The main method in the given main class must be static")
}
try { try {
mainMethod.invoke(null, childArgs.toArray) mainMethod.invoke(null, childArgs.toArray)
} catch { } catch {
......
...@@ -283,11 +283,9 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments, ...@@ -283,11 +283,9 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments,
} }
val sparkContext = sparkContextRef.get() val sparkContext = sparkContextRef.get()
assert(sparkContext != null || count >= numTries)
if (sparkContext == null) { if (sparkContext == null) {
logError( logError(("SparkContext did not initialize after waiting for %d ms. Please check earlier"
"Unable to retrieve sparkContext inspite of waiting for %d, numTries = %d".format( + " log output for errors. Failing the application.").format(numTries * waitTime))
count * waitTime, numTries))
} }
sparkContext sparkContext
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment