Skip to content

Commit

Permalink
Log long form of creation site to aid debugging.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshRosen committed Nov 6, 2014
1 parent 918e878 commit c4d35a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ class SparkContext(config: SparkConf) extends SparkStatusAPI with Logging {
SparkContext.activeSparkContextCreationSite.foreach { creationSite =>
val errMsg = "Only one SparkContext may be active in this JVM (see SPARK-2243)."
val errDetails = if (SparkContext.activeSparkContextIsFullyConstructed) {
s"The currently active SparkContext was created at ${creationSite.shortForm}"
s"The currently active SparkContext was created at:\n${creationSite.longForm}"
} else {
s"Another SparkContext, created at ${creationSite.shortForm}, is either being constructed" +
" or threw an exception from its constructor; please restart your JVM in order to" +
" create a new SparkContext."
s"Another SparkContext is either being constructed or threw an exception from its" +
" constructor; please restart your JVM in order to create a new SparkContext." +
s"The current SparkContext was created at:\n${creationSite.longForm}"
}
val exception = new SparkException(s"$errMsg $errDetails")
if (conf.getBoolean("spark.driver.disableMultipleSparkContextsErrorChecking", false)) {
Expand Down

0 comments on commit c4d35a2

Please sign in to comment.