aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me/lucko/spark
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2019-09-03 18:58:01 +0100
committerLuck <git@lucko.me>2019-09-03 18:58:22 +0100
commitf30d490f3950dbe5a8c85634490e2c4ffb32954d (patch)
tree539e07d5f72833f7742bebd126dcba36c5aa361d /spark-common/src/main/java/me/lucko/spark
parent218abc1ac83622758d79a8643f6c9aa126334273 (diff)
downloadspark-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/src/main/java/me/lucko/spark')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java1
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;
});