mridulm commented on code in PR #50452:
URL: https://github.com/apache/spark/pull/50452#discussion_r2021561333


##########
core/src/main/scala/org/apache/spark/executor/Executor.scala:
##########
@@ -110,6 +110,21 @@ private[spark] class Executor(
   // finish downloading dependencies.
   private val updateDependenciesLock = new ReentrantLock()
 
+  private lazy val mdcIsSupported = {
+    try {
+      // This tests if any class initialization error is thrown
+      val testKey = System.nanoTime().toString
+      MDC.put(testKey, "testValue")
+      MDC.remove(testKey)
+
+      true
+    } catch {
+      case t: Throwable =>
+        logInfo("MDC is not supported.", t)
+        false
+    }
+  }
+

Review Comment:
   QQ: Can this not be moved to the companion object ?



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to