Skip to content

Commit 6182da6

Browse files
committed
Set a configurable limit on maximum call stack depth. It can be useful in memory-constrained situations with large numbers of stages.
1 parent 8fe2e34 commit 6182da6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/scala/org/apache/spark/util/Utils.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,9 +840,10 @@ private[spark] object Utils extends Logging {
840840
userCallStack += el.toString
841841
}
842842
}
843+
val userCallStackDepth = System.getProperty("spark.callstack.depth", "20").toInt
843844
CallSite(
844845
short = "%s at %s:%s".format(lastSparkMethod, firstUserFile, firstUserLine),
845-
long = userCallStack.mkString("\n"))
846+
long = userCallStack.take(userCallStackDepth).mkString("\n"))
846847
}
847848

848849
/** Return a string containing part of a file from byte 'start' to 'end'. */

0 commit comments

Comments
 (0)