提交 1a8a00a8 编写于 作者: K Kohsuke Kawaguchi

If CLI main thread fails, kill the JVM no matter what.

This prevents a long running CLI process (such as CloudBees OPE
proccesses) to hang forever when the main thread fails.

Whereas if the process terminates cleanly, the wrapper (such as systemd)
can take corrective actions.
上级 6dbf13ac
......@@ -384,7 +384,13 @@ public class CLI {
// h.setLevel(ALL);
// l.addHandler(h);
//
System.exit(_main(_args));
try {
System.exit(_main(_args));
} catch (Throwable t) {
// if the CLI main thread die, make sure to kill the JVM.
t.printStackTrace();
System.exit(-1);
}
}
public static int _main(String[] _args) throws Exception {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册