panbingkun commented on code in PR #45890:
URL: https://github.com/apache/spark/pull/45890#discussion_r1553617107


##########
core/src/main/scala/org/apache/spark/util/Utils.scala:
##########
@@ -1276,11 +1276,13 @@ private[spark] object Utils
       case t: Throwable =>
         val currentThreadName = Thread.currentThread().getName
         if (sc != null) {
-          logError(s"uncaught error in thread $currentThreadName, stopping 
SparkContext", t)
+          logError(
+            log"uncaught error in thread ${MDC(THREAD, currentThreadName)}, 
stopping SparkContext",
+            t)
           sc.stopInNewThread()
         }
         if (!NonFatal(t)) {
-          logError(s"throw uncaught fatal error in thread $currentThreadName", 
t)
+          logError(log"throw uncaught fatal error in thread ${MDC(THREAD, 
currentThreadName)}", t)

Review Comment:
   dito



##########
core/src/main/scala/org/apache/spark/util/Utils.scala:
##########
@@ -1292,7 +1294,8 @@ private[spark] object Utils
       block
     } catch {
       case NonFatal(t) =>
-        logError(s"Uncaught exception in thread 
${Thread.currentThread().getName}", t)
+        logError(
+          log"Uncaught exception in thread ${MDC(THREAD, 
Thread.currentThread().getName)}", t)

Review Comment:
   dito



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to