diff --git a/tasks/src/main/scala/sbt/CompletionService.scala b/tasks/src/main/scala/sbt/CompletionService.scala index 18ed0c481..2338ca885 100644 --- a/tasks/src/main/scala/sbt/CompletionService.scala +++ b/tasks/src/main/scala/sbt/CompletionService.scala @@ -34,8 +34,19 @@ object CompletionService { def take() = completion.take().get() } def submit[T](work: () => T, completion: JCompletionService[T]): () => T = { - val future = try completion.submit { new Callable[T] { def call = work() } } catch { - case _: RejectedExecutionException => throw Incomplete(None, message = Some("cancelled")) + val future = try completion.submit { + new Callable[T] { + def call = + try { + work() + } catch { + case _: InterruptedException => + throw Incomplete(None, message = Some("cancelled")) + } + } + } catch { + case _: RejectedExecutionException => + throw Incomplete(None, message = Some("cancelled")) } () => future.get() }