sofastack / sofa-boot

SOFABoot is a framework that enhances Spring Boot and fully compatible with it, provides readiness check, class isolation, etc.

Home Page:https://www.sofastack.tech/sofa-boot/docs/Home

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

线程池监听统计调度线程使用非守护线程是否会存在应用停止时无法正常关闭?

lveliu opened this issue · comments

在 ThreadPoolGovernor 中 创建了线程池监听调度线程池 monitorScheduler,monitorScheduler 的线程创建是通过 new NamedThreadFactory("SOFA-Thread-Pool-Monitor") 进行处理,在 NamedThreadFactory 默认构造方法中
public NamedThreadFactory(String name) {
this(name, false);
}创建的是非守护进程,在外部也未发现 monitorScheduler 调用shutdown方法,请问在应用正常stop时是否无法停止线程池 monitorScheduler 已创建的监听线程。

是的,这个线程池没有添加关闭的钩子,会随着JVM的生命周期结束关闭