mirror of https://github.com/sbt/sbt.git
Merge pull request #5832 from eatkins/tcp-socket
Catch SocketException on server shutdown
This commit is contained in:
commit
1514f96492
|
|
@ -10,7 +10,7 @@ package internal
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import java.io.{ File, IOException }
|
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.util.concurrent.atomic.{ AtomicBoolean, AtomicReference }
|
||||||
import java.nio.file.attribute.{ AclEntry, AclEntryPermission, AclEntryType, UserPrincipal }
|
import java.nio.file.attribute.{ AclEntry, AclEntryPermission, AclEntryType, UserPrincipal }
|
||||||
import java.security.SecureRandom
|
import java.security.SecureRandom
|
||||||
|
|
@ -110,6 +110,7 @@ private[sbt] object Server {
|
||||||
} catch {
|
} catch {
|
||||||
case e: IOException if e.getMessage.contains("connect") =>
|
case e: IOException if e.getMessage.contains("connect") =>
|
||||||
case _: SocketTimeoutException => // its ok
|
case _: SocketTimeoutException => // its ok
|
||||||
|
case _: SocketException if !running.get => // the server is shutting down
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
serverSocketHolder.get match {
|
serverSocketHolder.get match {
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ object LintUnused {
|
||||||
onLoadMessage,
|
onLoadMessage,
|
||||||
onUnload,
|
onUnload,
|
||||||
sbt.nio.Keys.watchTriggers,
|
sbt.nio.Keys.watchTriggers,
|
||||||
|
serverConnectionType,
|
||||||
),
|
),
|
||||||
includeLintKeys := Set(
|
includeLintKeys := Set(
|
||||||
scalacOptions,
|
scalacOptions,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue