fix issue #1187: close shell when removing session

This commit is contained in:
gongdewei 2020-05-20 19:02:53 +08:00
parent eb62e0dec2
commit 5c01dc4307

View File

@ -19,7 +19,6 @@ import com.taobao.arthas.core.shell.system.impl.InternalCommandManager;
import com.taobao.arthas.core.shell.system.impl.JobControllerImpl;
import com.taobao.arthas.core.shell.term.Term;
import com.taobao.arthas.core.shell.term.TermServer;
import com.taobao.arthas.core.shell.term.impl.httptelnet.HttpTelnetTermServer;
import java.lang.instrument.Instrumentation;
import java.util.ArrayList;
@ -184,6 +183,7 @@ public class ShellServerImpl extends ShellServer {
synchronized (ShellServerImpl.this) {
sessions.remove(shell.id);
shell.close("network error");
completeSessionClosed = sessions.isEmpty() && closed;
}
if (completeSessionClosed) {