mirror of https://github.com/sbt/sbt.git
Catch interrupted exceptions in blockUntilNextExec
It is possible for an InterruptedException to be thrown here because of logic in NetworkClient. This seemed to be the root cause of the fix I tried inca251eb7c8so I'm reverting that commit. Revert "Catch interrupted exception in shell" This reverts commitca251eb7c8.
This commit is contained in:
parent
5fee13ad5a
commit
3966d2fcb2
|
|
@ -1041,19 +1041,17 @@ object BuiltinCommands {
|
|||
.extract(s1)
|
||||
.getOpt(Keys.minForcegcInterval)
|
||||
.getOrElse(GCUtil.defaultMinForcegcInterval)
|
||||
try {
|
||||
val exec: Exec = getExec(s1, minGCInterval)
|
||||
val newState = s1
|
||||
.copy(
|
||||
onFailure = Some(Exec(Shell, None)),
|
||||
remainingCommands = exec +: Exec(Shell, None) +: s1.remainingCommands
|
||||
)
|
||||
.setInteractive(true)
|
||||
val res =
|
||||
if (exec.commandLine.trim.isEmpty) newState
|
||||
else newState.clearGlobalLog
|
||||
res
|
||||
} catch { case _: InterruptedException => s1.exit(true) }
|
||||
val exec: Exec = getExec(s1, minGCInterval)
|
||||
val newState = s1
|
||||
.copy(
|
||||
onFailure = Some(Exec(Shell, None)),
|
||||
remainingCommands = exec +: Exec(Shell, None) +: s1.remainingCommands
|
||||
)
|
||||
.setInteractive(true)
|
||||
val res =
|
||||
if (exec.commandLine.trim.isEmpty) newState
|
||||
else newState.clearGlobalLog
|
||||
res
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ private[sbt] final class CommandExchange {
|
|||
case s @ Seq(_, _) => Some(s.min)
|
||||
case s => s.headOption
|
||||
}
|
||||
Option(deadline match {
|
||||
try Option(deadline match {
|
||||
case Some(d: Deadline) =>
|
||||
commandQueue.poll(d.timeLeft.toMillis + 1, TimeUnit.MILLISECONDS) match {
|
||||
case null if idleDeadline.fold(false)(_.isOverdue) =>
|
||||
|
|
@ -106,6 +106,7 @@ private[sbt] final class CommandExchange {
|
|||
}
|
||||
case _ => commandQueue.take
|
||||
})
|
||||
catch { case _: InterruptedException => None }
|
||||
}
|
||||
poll match {
|
||||
case Some(exec) if exec.source.fold(true)(s => channels.exists(_.name == s.channelName)) =>
|
||||
|
|
|
|||
Loading…
Reference in New Issue