diff options
author | Luck <git@lucko.me> | 2019-09-03 18:58:01 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2019-09-03 18:58:22 +0100 |
commit | f30d490f3950dbe5a8c85634490e2c4ffb32954d (patch) | |
tree | 539e07d5f72833f7742bebd126dcba36c5aa361d /spark-common | |
parent | 218abc1ac83622758d79a8643f6c9aa126334273 (diff) | |
download | spark-f30d490f3950dbe5a8c85634490e2c4ffb32954d.tar.gz spark-f30d490f3950dbe5a8c85634490e2c4ffb32954d.tar.bz2 spark-f30d490f3950dbe5a8c85634490e2c4ffb32954d.zip |
Cpu monitoring thread should be a daemon thread
This will allow the JVM to shut down even if the cpu monitor is still running.
Diffstat (limited to 'spark-common')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java b/spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java index cd451ed..aa653b7 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java +++ b/spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java @@ -45,6 +45,7 @@ public enum CpuMonitor { private static final ScheduledExecutorService EXECUTOR = Executors.newSingleThreadScheduledExecutor(r -> { Thread thread = Executors.defaultThreadFactory().newThread(r); thread.setName("spark-cpu-monitor"); + thread.setDaemon(true); return thread; }); |