mirror of https://github.com/apache/druid.git
Merge pull request #1830 from metamx/peonDaemonChecker
Check for non-daemon threads when CliPeon exits
This commit is contained in:
commit
8d1686039a
|
@ -85,6 +85,7 @@ import org.eclipse.jetty.server.Server;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
|
@ -246,6 +247,15 @@ public class CliPeon extends GuiceRunnable
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
injector.getInstance(ExecutorLifecycle.class).join();
|
injector.getInstance(ExecutorLifecycle.class).join();
|
||||||
|
|
||||||
|
// Sanity check to help debug unexpected non-daemon threads
|
||||||
|
final Set<Thread> threadSet = Thread.getAllStackTraces().keySet();
|
||||||
|
for (Thread thread : threadSet) {
|
||||||
|
if (!thread.isDaemon() && thread != Thread.currentThread()) {
|
||||||
|
log.info("Thread [%s] is non daemon.", thread);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Explicitly call lifecycle stop, dont rely on shutdown hook.
|
// Explicitly call lifecycle stop, dont rely on shutdown hook.
|
||||||
lifecycle.stop();
|
lifecycle.stop();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue