Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-8689

Fail to Recover Remaining Tasks in BatchExecutor

    Details

      Description

      In scala.concurrent.BatchExecutor$Batch.run() of Scala 2.11.1.

      If `head.run()` BatchingExecutor.scala(63) throws a exception, remaining tasks will attempt to execute. But `require(_tasksLocal.get eq null)` at the beginning of the `Batch.run()` that is called recursively from `unbatchedExecute()` will always fail because it set the `Nil` to `_tasksLocal` here.
      This hides the original cause. `_tasksLocal` should `remove()` because the remaining tasks are passed as an argument.

      java.lang.IllegalStateException: problem in scala.concurrent internal callback
      at scala.concurrent.Future$InternalCallbackExecutor$.reportFailure(Future.scala:601)
      at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40)
      at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248)
      at scala.concurrent.Promise$class.complete(Promise.scala:55)
      at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153)
      at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
      at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
      at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
      at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
      at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
      at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)
      at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)
      at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
      at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
      Caused by: java.lang.IllegalArgumentException: requirement failed
      at scala.Predef$.require(Predef.scala:207)
      at scala.concurrent.BatchingExecutor$Batch.run(BatchingExecutor.scala:51)
      at scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:599)
      at scala.concurrent.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:72)
      at scala.concurrent.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:78)
      at scala.concurrent.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:55)
      at scala.concurrent.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:55)
      at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
      at scala.concurrent.BatchingExecutor$Batch.run(BatchingExecutor.scala:54)
      at scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:599)
      at scala.concurrent.BatchingExecutor$class.execute(BatchingExecutor.scala:106)
      at scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:597)
      ... 13 more

        Attachments

          Activity

            People

            • Assignee:
              viktor.klang Viktor Klang
              Reporter:
              torao Takami Torao
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: