Skip to content

Commit 4448cb2

Browse files
committed
only set if mdc is not null
1 parent 778da7a commit 4448cb2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

launcher/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
<dependency>
5959
<groupId>org.slf4j</groupId>
6060
<artifactId>slf4j-log4j12</artifactId>
61-
<scope>test</scope>
6261
</dependency>
6362

6463
<dependency>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ synchronized void start(String appName, Method main, String[] args) {
6363

6464
Map<String, String> mdcContextMap = MDC.getCopyOfContextMap();
6565
app = new Thread(() -> {
66-
MDC.setContextMap(mdcContextMap);
66+
if (mdcContextMap != null) {
67+
MDC.setContextMap(mdcContextMap);
68+
}
6769
try {
6870
main.invoke(null, (Object) args);
6971
} catch (Throwable t) {

0 commit comments

Comments
 (0)