scala.NotImplementedError

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • The fork join execution context loses fatal exceptions. It should allow them to be handled by the threads uncaught exception handler, so that they can be logged. But it doesn't, they get lost, not reported anywhere. Here is an example in the repl: {noformat} scala> import scala.concurrent._ import scala.concurrent._ scala> val ec = scala.concurrent.ExecutionContext.global ec: scala.concurrent.ExecutionContextExecutor = scala.concurrent.impl.ExecutionContextImpl@4a640180 scala> val f = Future[Unit](throw new NotImplementedError())(ec) f: scala.concurrent.Future[Unit] = scala.concurrent.impl.Promise$DefaultPromise@3ec9e1f9 {noformat} Nothing happens. What I expected is for my NotImplementedError to be at least handled by the uncaught exception handler, and logged. Now, I know the uncaught exception handler is there and working: {noformat} scala> val f = Future[Unit](Thread.currentThread.getUncaughtExceptionHandler.uncaughtException(Thread.currentThread, new NotImplementedError()))(ec) f: scala.concurrent.Future[Unit] = scala.concurrent.impl.Promise$DefaultPromise@4aac53a8 Exception in thread "ForkJoinPool-1-worker-1" scala.NotImplementedError: an implementation is missing at $line53.$read$$iw$$iw$$iw$$iw$$anonfun$1.apply$mcV$sp(<console>:11) at $line53.$read$$iw$$iw$$iw$$iw$$anonfun$1.apply(<console>:11) at $line53.$read$$iw$$iw$$iw$$iw$$anonfun$1.apply(<console>:11) at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) at scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1417) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) {noformat} And if I use a different execution context, such as a Java executor, it works as expected: {noformat} scala> val es = java.util.concurrent.Executors.newSingleThreadExecutor es: java.util.concurrent.ExecutorService = java.util.concurrent.Executors$FinalizableDelegatedExecutorService@10cd508f scala> val ec = ExecutionContext.fromExecutorService(es) ec: scala.concurrent.ExecutionContextExecutorService = scala.concurrent.impl.ExecutionContextImpl$$anon$1@11e9c5a7 scala> val f = Future[Unit](throw new NotImplementedError())(ec) f: scala.concurrent.Future[Unit] = scala.concurrent.impl.Promise$DefaultPromise@7309eabd Exception in thread "pool-1-thread-1" scala.NotImplementedError: an implementation is missing at $line69.$read$$iw$$iw$$iw$$iw$$anonfun$1.apply(<console>:12) at $line69.$read$$iw$$iw$$iw$$iw$$anonfun$1.apply(<console>:12) at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) {noformat}
    via by James Roper,
  • The fork join execution context loses fatal exceptions. It should allow them to be handled by the threads uncaught exception handler, so that they can be logged. But it doesn't, they get lost, not reported anywhere. Here is an example in the repl: {noformat} scala> import scala.concurrent._ import scala.concurrent._ scala> val ec = scala.concurrent.ExecutionContext.global ec: scala.concurrent.ExecutionContextExecutor = scala.concurrent.impl.ExecutionContextImpl@4a640180 scala> val f = Future[Unit](throw new NotImplementedError())(ec) f: scala.concurrent.Future[Unit] = scala.concurrent.impl.Promise$DefaultPromise@3ec9e1f9 {noformat} Nothing happens. What I expected is for my NotImplementedError to be at least handled by the uncaught exception handler, and logged. Now, I know the uncaught exception handler is there and working: {noformat} scala> val f = Future[Unit](Thread.currentThread.getUncaughtExceptionHandler.uncaughtException(Thread.currentThread, new NotImplementedError()))(ec) f: scala.concurrent.Future[Unit] = scala.concurrent.impl.Promise$DefaultPromise@4aac53a8 Exception in thread "ForkJoinPool-1-worker-1" scala.NotImplementedError: an implementation is missing at $line53.$read$$iw$$iw$$iw$$iw$$anonfun$1.apply$mcV$sp(<console>:11) at $line53.$read$$iw$$iw$$iw$$iw$$anonfun$1.apply(<console>:11) at $line53.$read$$iw$$iw$$iw$$iw$$anonfun$1.apply(<console>:11) at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) at scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1417) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) {noformat} And if I use a different execution context, such as a Java executor, it works as expected: {noformat} scala> val es = java.util.concurrent.Executors.newSingleThreadExecutor es: java.util.concurrent.ExecutorService = java.util.concurrent.Executors$FinalizableDelegatedExecutorService@10cd508f scala> val ec = ExecutionContext.fromExecutorService(es) ec: scala.concurrent.ExecutionContextExecutorService = scala.concurrent.impl.ExecutionContextImpl$$anon$1@11e9c5a7 scala> val f = Future[Unit](throw new NotImplementedError())(ec) f: scala.concurrent.Future[Unit] = scala.concurrent.impl.Promise$DefaultPromise@7309eabd Exception in thread "pool-1-thread-1" scala.NotImplementedError: an implementation is missing at $line69.$read$$iw$$iw$$iw$$iw$$anonfun$1.apply(<console>:12) at $line69.$read$$iw$$iw$$iw$$iw$$anonfun$1.apply(<console>:12) at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) {noformat}
    via by James Roper,
    • scala.NotImplementedError: an implementation is missing at $line53.$read$$iw$$iw$$iw$$iw$$anonfun$1.apply$mcV$sp(<console>:11) at $line53.$read$$iw$$iw$$iw$$iw$$anonfun$1.apply(<console>:11) at $line53.$read$$iw$$iw$$iw$$iw$$anonfun$1.apply(<console>:11) at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) at scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1417) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
    No Bugmate found.