Skip to content

Commit e319436

Browse files
authored
[SPARK-24767] Propagate MDC to spark-submit thread in InProcessAppHandle (apache-spark-on-k8s#389)
[SPARK-24767] Propagate MDC to spark-submit thread in InProcessAppHandle (apache-spark-on-k8s#389) [SPARK-24813][BUILD][FOLLOW-UP][HOTFIX] HiveExternalCatalogVersionsSuite still flaky; fall back to Apache archive
2 parents eddf77b + 98b1a4f commit e319436

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

launcher/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
<dependency>
5555
<groupId>org.slf4j</groupId>
5656
<artifactId>slf4j-api</artifactId>
57-
<scope>test</scope>
5857
</dependency>
5958
<dependency>
6059
<groupId>org.slf4j</groupId>

launcher/src/main/java/org/apache/spark/launcher/InProcessAppHandle.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717

1818
package org.apache.spark.launcher;
1919

20+
import org.slf4j.MDC;
21+
2022
import java.lang.reflect.Method;
23+
import java.util.Map;
2124
import java.util.concurrent.atomic.AtomicLong;
2225
import java.util.logging.Level;
2326
import java.util.logging.Logger;
@@ -58,7 +61,11 @@ synchronized void start(String appName, Method main, String[] args) {
5861
appName = "..." + appName.substring(appName.length() - MAX_APP_NAME_LEN);
5962
}
6063

64+
Map<String, String> mdcContextMap = MDC.getCopyOfContextMap();
6165
app = new Thread(() -> {
66+
if (mdcContextMap != null) {
67+
MDC.setContextMap(mdcContextMap);
68+
}
6269
try {
6370
main.invoke(null, (Object) args);
6471
} catch (Throwable t) {

sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogVersionsSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class HiveExternalCatalogVersionsSuite extends SparkSubmitTestUtils {
195195

196196
object PROCESS_TABLES extends QueryTest with SQLTestUtils {
197197
// Tests the latest version of every release line.
198-
val testingVersions = Seq("2.0.2", "2.1.2", "2.2.1", "2.3.1")
198+
val testingVersions = Seq("2.1.3", "2.2.2", "2.3.1")
199199

200200
protected var spark: SparkSession = _
201201

0 commit comments

Comments
 (0)