Send exit in network client before shutdown

In the client test, the sbt server would keep open the the client
connection even after it had exited because the client was only shutting
down its side of the connection. Since in the test it wasn't exiting the
jvm, the read side of the connection was still open.
This commit is contained in:
Ethan Atkins 2020-09-27 10:05:51 -07:00
parent 7d4019614a
commit 90f6d77d59
1 changed files with 3 additions and 1 deletions

View File

@ -919,7 +919,9 @@ class NetworkClient(
if (mainThread != null && mainThread != Thread.currentThread) mainThread.interrupt
connectionHolder.get match {
case null =>
case c => c.shutdown()
case c =>
try sendExecCommand("exit")
finally c.shutdown()
}
Option(inputThread.get).foreach(_.interrupt())
} catch {