mirror of https://github.com/sbt/sbt.git
Catch RejectedExecutionException in Execute#runKeep
This commit is contained in:
parent
70d3484896
commit
d48aa310e6
|
|
@ -11,7 +11,6 @@ import sbt.internal.{ Load, BuildStructure, TaskTimings, TaskName, GCUtil }
|
|||
import sbt.internal.util.{ Attributed, ErrorHandling, HList, RMap, Signals, Types }
|
||||
import sbt.util.{ Logger, Show }
|
||||
import sbt.librarymanagement.{ Resolver, UpdateReport }
|
||||
import java.util.concurrent.RejectedExecutionException
|
||||
|
||||
import scala.concurrent.duration.Duration
|
||||
import java.io.File
|
||||
|
|
@ -388,11 +387,7 @@ object EvaluateTask {
|
|||
val results = x.runKeep(root)(service)
|
||||
storeValuesForPrevious(results, state, streams)
|
||||
applyResults(results, state, root)
|
||||
} catch {
|
||||
case _: RejectedExecutionException =>
|
||||
(state, Inc(Incomplete(None, message = Some("cancelled"))))
|
||||
case inc: Incomplete => (state, Inc(inc))
|
||||
} finally shutdown()
|
||||
} catch { case inc: Incomplete => (state, Inc(inc)) } finally shutdown()
|
||||
val replaced = transformInc(result)
|
||||
logIncResult(replaced, state, streams)
|
||||
(newState, replaced)
|
||||
|
|
|
|||
|
|
@ -78,22 +78,21 @@ private[sbt] final class Execute[A[_] <: AnyRef](
|
|||
"State: " + state.toString + "\n\nResults: " + results + "\n\nCalls: " + callers + "\n\n"
|
||||
|
||||
def run[T](root: A[T])(implicit strategy: Strategy): Result[T] =
|
||||
try {
|
||||
runKeep(root)(strategy)(root)
|
||||
} catch {
|
||||
case i: Incomplete => Inc(i)
|
||||
case _: RejectedExecutionException => Inc(Incomplete(None, message = Some("cancelled")))
|
||||
}
|
||||
def runKeep[T](root: A[T])(implicit strategy: Strategy): RMap[A, Result] = {
|
||||
assert(state.isEmpty, "Execute already running/ran.")
|
||||
try { runKeep(root)(strategy)(root) } catch { case i: Incomplete => Inc(i) }
|
||||
|
||||
addNew(root)
|
||||
processAll()
|
||||
assert(results contains root, "No result for root node.")
|
||||
val finalResults = triggers.onComplete(results)
|
||||
progressState = progress.allCompleted(progressState, finalResults)
|
||||
finalResults
|
||||
}
|
||||
def runKeep[T](root: A[T])(implicit strategy: Strategy): RMap[A, Result] =
|
||||
try {
|
||||
assert(state.isEmpty, "Execute already running/ran.")
|
||||
|
||||
addNew(root)
|
||||
processAll()
|
||||
assert(results contains root, "No result for root node.")
|
||||
val finalResults = triggers.onComplete(results)
|
||||
progressState = progress.allCompleted(progressState, finalResults)
|
||||
finalResults
|
||||
} catch {
|
||||
case _: RejectedExecutionException => throw Incomplete(None, message = Some("cancelled"))
|
||||
}
|
||||
|
||||
def processAll()(implicit strategy: Strategy): Unit = {
|
||||
@tailrec def next(): Unit = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue