hadoop: use daemon thread to run trash emptier (#6351)

This commit is contained in:
tangyoupeng
2025-09-10 10:14:46 +08:00
committed by GitHub
parent 884686dd47
commit 24631329e5

View File

@@ -128,7 +128,11 @@ public class BgTaskUtil {
String key = name + "|" + "Trash emptier";
if (!tasks.containsKey(key)) {
LOG.debug("run trash emptier for {}", name);
ScheduledExecutorService thread = Executors.newScheduledThreadPool(1);
ScheduledExecutorService thread = Executors.newScheduledThreadPool(1, r -> {
Thread t = new Thread(r, "JuiceFS Trash Emptier");
t.setDaemon(true);
return t;
});
thread.schedule(emptierTask, delay, unit);
tasks.put(key, thread);
}