Catch SocketException on server shutdown

Fixes #5829
This commit is contained in:
Ethan Atkins 2020-09-10 11:54:04 -07:00
parent 771ac51cb2
commit 828aac8fe5
1 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,7 @@ package internal
package server
import java.io.{ File, IOException }
import java.net.{ InetAddress, ServerSocket, Socket, SocketTimeoutException }
import java.net.{ InetAddress, ServerSocket, Socket, SocketException, SocketTimeoutException }
import java.util.concurrent.atomic.{ AtomicBoolean, AtomicReference }
import java.nio.file.attribute.{ AclEntry, AclEntryPermission, AclEntryType, UserPrincipal }
import java.security.SecureRandom
@ -110,6 +110,7 @@ private[sbt] object Server {
} catch {
case e: IOException if e.getMessage.contains("connect") =>
case _: SocketTimeoutException => // its ok
case _: SocketException if !running.get => // the server is shutting down
}
}
serverSocketHolder.get match {