You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/05/04 08:32:45 UTC
[GitHub] [spark] Ngone51 commented on a change in pull request #26624: [SPARK-8981][CORE][test-hadoop3.2][test-java11] Add MDC support in Executor
Ngone51 commented on a change in pull request #26624:
URL: https://github.com/apache/spark/pull/26624#discussion_r419284176
##########
File path: core/src/main/scala/org/apache/spark/executor/Executor.scala
##########
@@ -674,6 +677,18 @@ private[spark] class Executor(
}
}
+ private def setMDCForTask(taskDescription: TaskDescription): Unit = {
+ val properties = taskDescription.properties
+
+ org.slf4j.MDC.put("appId", properties.getProperty("spark.app.id"))
+ org.slf4j.MDC.put("appName", properties.getProperty("spark.app.name"))
+
+ properties.asScala.filter(_._1.startsWith("mdc.")).foreach { item =>
+ val key = item._1.substring(4)
+ org.slf4j.MDC.put(key, item._2)
Review comment:
IIUC, MDC values can only be propagated at executor side and only the threads which created after task threads could see the values. So I am really confused that how can you guarantee values can be propagated to all places?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org