From f30d490f3950dbe5a8c85634490e2c4ffb32954d Mon Sep 17 00:00:00 2001 From: Luck Date: Tue, 3 Sep 2019 18:58:01 +0100 Subject: Cpu monitoring thread should be a daemon thread This will allow the JVM to shut down even if the cpu monitor is still running. --- .../src/main/java/me/lucko/spark/common/monitor/cpu/CpuMonitor.java | 1 + 1 file changed, 1 insertion(+) (limited to 'spark-common') 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; }); -- cgit