diff options
author | Mikael Ståldal <mikael.staldal@magine.com> | 2016-07-24 11:16:24 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-07-24 11:16:24 +0100 |
commit | 23e047f4609bf39f50ea4c65f704cac15408a821 (patch) | |
tree | 52810e3e06add116cd37b37191d34a65000573db /streaming/src | |
parent | 37bed97de5f81a9127f1ff12db695aab6e5c4c47 (diff) | |
download | spark-23e047f4609bf39f50ea4c65f704cac15408a821.tar.gz spark-23e047f4609bf39f50ea4c65f704cac15408a821.tar.bz2 spark-23e047f4609bf39f50ea4c65f704cac15408a821.zip |
[SPARK-16416][CORE] force eager creation of loggers to avoid shutdown hook conflicts
## What changes were proposed in this pull request?
Force eager creation of loggers to avoid shutdown hook conflicts.
## How was this patch tested?
Manually tested with a project using Log4j 2, verified that the shutdown hook conflict issue was solved.
Author: Mikael Ståldal <mikael.staldal@magine.com>
Closes #14320 from mikaelstaldal/shutdown-hook-logging.
Diffstat (limited to 'streaming/src')
-rw-r--r-- | streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala b/streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala index 6046426fdf..4808d0fcbc 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala @@ -592,6 +592,7 @@ class StreamingContext private[streaming] ( } StreamingContext.setActiveContext(this) } + logDebug("Adding shutdown hook") // force eager creation of logger shutdownHookRef = ShutdownHookManager.addShutdownHook( StreamingContext.SHUTDOWN_HOOK_PRIORITY)(stopOnShutdown) // Registering Streaming Metrics at the start of the StreamingContext |