From 11c130e44e159029ea47d63598c6e47f4d908eb2 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Wed, 25 Apr 2012 00:51:23 +0200 Subject: [PATCH] The only sensible solution is to log and rethrow, nooptimal solution. --- akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala index 5537b01244c..fbffd08d7ed 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala @@ -4,7 +4,7 @@ package akka.dispatch -import akka.event.Logging.Warning +import akka.event.Logging.Error import java.util.concurrent.atomic.AtomicReference import akka.actor.ActorCell import akka.util.Duration @@ -59,7 +59,7 @@ class Dispatcher( executorService.get() execute invocation } catch { case e2: RejectedExecutionException ⇒ - prerequisites.eventStream.publish(Warning("Dispatcher", this.getClass, e2.toString)) + prerequisites.eventStream.publish(Error(e, getClass.getName, getClass, "executeTask was rejected twice!")) throw e2 } } @@ -87,7 +87,10 @@ class Dispatcher( executorService.get() execute mbox true } catch { //Retry once - case e: RejectedExecutionException ⇒ mbox.setAsIdle(); throw e + case e: RejectedExecutionException ⇒ + mbox.setAsIdle() + prerequisites.eventStream.publish(Error(e, getClass.getName, getClass, "registerForExecution was rejected twice!")) + throw e } } } else false