Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use a string conf, and some style
  • Loading branch information
victors-oai committed Oct 21, 2025
commit df2f6ce42e8a20944f3a3df0967d3accd6f8e3b2
8 changes: 5 additions & 3 deletions core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,9 @@ private[spark] class SparkSubmit extends Logging {
case _ =>
}
// Store the diagnostics externally if enabled, but still throw to complete the application.
storeDiagnostics(args, sparkConf, cause)
if (sparkConf.getBoolean("spark.kubernetes.storeDiagnostics", false)) {
storeDiagnostics(args, sparkConf, cause)
}
throw cause
} finally {
if (args.master.startsWith("k8s") && !isShell(args.primaryResource) &&
Expand Down Expand Up @@ -1070,12 +1072,12 @@ private[spark] class SparkSubmit extends Logging {
// Swallow exceptions when storing diagnostics, this shouldn't fail the application.
try {
if (!isShell(args.primaryResource) && !isSqlShell(args.mainClass)
&& !isThriftServer(args.mainClass) && !isConnectServer(args.mainClass)) {
&& !isThriftServer(args.mainClass) && !isConnectServer(args.mainClass)) {
SparkSubmitUtils.getSparkDiagnosticsSetters(args.master, sparkConf)
.foreach(_.setDiagnostics(throwable, sparkConf))
}
} catch {
case e: Throwable => logWarning(s"Failed to set diagnostics: $e")
case e: Throwable => logDebug(s"Failed to set diagnostics: $e")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ private[spark] object Config extends Logging {
val KUBERNETES_STORE_DIAGNOSTICS =
ConfigBuilder("spark.kubernetes.storeDiagnostics")
.doc("If set to true, Spark will store diagnostics information for failed applications in" +
s" the Kubernetes API server using the ${DIAGNOSTICS_ANNOTATION} annotation.")
s" the Kubernetes API server using the $DIAGNOSTICS_ANNOTATION annotation.")
.version("4.1.0")
.booleanConf
.createWithDefault(false)
Expand Down