mirror of
https://gitee.com/arthas/arthas.git
synced 2024-12-03 12:48:48 +08:00
close ShellServer and SessionManager when shutdown
This commit is contained in:
parent
a318bbdabe
commit
62c47c4259
@ -1,9 +1,11 @@
|
||||
package com.taobao.arthas.core.command.basic1000;
|
||||
|
||||
import com.taobao.arthas.core.advisor.Enhancer;
|
||||
import com.taobao.arthas.core.server.ArthasBootstrap;
|
||||
import com.taobao.arthas.core.shell.ShellServer;
|
||||
import com.taobao.arthas.core.shell.command.AnnotatedCommand;
|
||||
import com.taobao.arthas.core.shell.command.CommandProcess;
|
||||
import com.taobao.arthas.core.shell.session.SessionManager;
|
||||
import com.taobao.arthas.core.util.affect.EnhancerAffect;
|
||||
import com.taobao.arthas.core.util.matcher.WildcardMatcher;
|
||||
import com.taobao.middleware.cli.annotations.Hidden;
|
||||
@ -39,8 +41,15 @@ public class ShutdownCommand extends AnnotatedCommand {
|
||||
// ignore
|
||||
} finally {
|
||||
process.end();
|
||||
ShellServer server = process.session().getServer();
|
||||
server.close();
|
||||
ShellServer server = ArthasBootstrap.getInstance().getShellServer();
|
||||
if (server != null) {
|
||||
server.close();
|
||||
}
|
||||
|
||||
SessionManager sessionManager = ArthasBootstrap.getInstance().getSessionManager();
|
||||
if (sessionManager != null){
|
||||
sessionManager.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user