mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
Merge branch 'master' into oneagent
This commit is contained in:
@@ -313,8 +313,8 @@ public class ProcessUtils {
|
||||
// find arthas-client.jar
|
||||
URLClassLoader classLoader = new URLClassLoader(
|
||||
new URL[]{new File(arthasHomeDir, "arthas-client.jar").toURI().toURL()});
|
||||
Class<?> telnetConsoleClas = classLoader.loadClass("com.taobao.arthas.client.TelnetConsole");
|
||||
Method processMethod = telnetConsoleClas.getMethod("process", String[].class);
|
||||
Class<?> telnetConsoleClass = classLoader.loadClass("com.taobao.arthas.client.TelnetConsole");
|
||||
Method processMethod = telnetConsoleClass.getMethod("process", String[].class);
|
||||
|
||||
//redirect System.out/System.err
|
||||
PrintStream originSysOut = System.out;
|
||||
|
||||
+16
-1
@@ -71,6 +71,22 @@ public class SessionManagerImpl implements SessionManager {
|
||||
|
||||
@Override
|
||||
public Session removeSession(String sessionId) {
|
||||
Session session = sessions.get(sessionId);
|
||||
if (session == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
//interrupt foreground job
|
||||
Job job = session.getForegroundJob();
|
||||
if (job != null) {
|
||||
job.interrupt();
|
||||
}
|
||||
|
||||
SharingResultDistributor resultDistributor = session.getResultDistributor();
|
||||
if (resultDistributor != null) {
|
||||
resultDistributor.close();
|
||||
}
|
||||
|
||||
return sessions.remove(sessionId);
|
||||
}
|
||||
|
||||
@@ -92,7 +108,6 @@ public class SessionManagerImpl implements SessionManager {
|
||||
SharingResultDistributor resultDistributor = session.getResultDistributor();
|
||||
if (resultDistributor != null) {
|
||||
resultDistributor.appendResult(new MessageModel("arthas server is going to shutdown."));
|
||||
resultDistributor.close();
|
||||
}
|
||||
logger.info("Removing session before shutdown: {}, last access time: {}", session.getSessionId(), session.getLastAccessTime());
|
||||
this.removeSession(session.getSessionId());
|
||||
|
||||
Reference in New Issue
Block a user