From 786a8bf08430db2dfeeeedbd467d64f64a7c8361 Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Tue, 30 Jun 2026 13:55:57 +0800 Subject: [PATCH 1/2] [SPARK-57774][CORE] DriverLogger should ignore log4j internal exception --- .../scala/org/apache/spark/util/logging/DriverLogger.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/org/apache/spark/util/logging/DriverLogger.scala b/core/src/main/scala/org/apache/spark/util/logging/DriverLogger.scala index 9854c99707b1c..f3d1927792969 100644 --- a/core/src/main/scala/org/apache/spark/util/logging/DriverLogger.scala +++ b/core/src/main/scala/org/apache/spark/util/logging/DriverLogger.scala @@ -71,7 +71,9 @@ private[spark] class DriverLogger(conf: SparkConf) extends Logging { builder.setBufferedIo(false) builder.setConfiguration(config) builder.withFileName(localLogFile) - builder.setIgnoreExceptions(false) + // SPARK-57774: Set to true to avoid log4j internal exception (e.g., due to log4j bugs) + // propagating to the caller. + builder.setIgnoreExceptions(true) builder.setLayout(layout) builder.setName(DriverLogger.APPENDER_NAME) builder.build() From 54b9715c2ab1f311329e86eaadb89c60c4979a77 Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Tue, 30 Jun 2026 14:15:34 +0800 Subject: [PATCH 2/2] nit --- .../scala/org/apache/spark/util/logging/DriverLogger.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/util/logging/DriverLogger.scala b/core/src/main/scala/org/apache/spark/util/logging/DriverLogger.scala index f3d1927792969..a5206f5282fa5 100644 --- a/core/src/main/scala/org/apache/spark/util/logging/DriverLogger.scala +++ b/core/src/main/scala/org/apache/spark/util/logging/DriverLogger.scala @@ -71,8 +71,8 @@ private[spark] class DriverLogger(conf: SparkConf) extends Logging { builder.setBufferedIo(false) builder.setConfiguration(config) builder.withFileName(localLogFile) - // SPARK-57774: Set to true to avoid log4j internal exception (e.g., due to log4j bugs) - // propagating to the caller. + // SPARK-57774: Set to true to avoid propagating log4j internal exception + // (e.g., due to log4j bugs) to the caller. builder.setIgnoreExceptions(true) builder.setLayout(layout) builder.setName(DriverLogger.APPENDER_NAME)