diff --git a/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala b/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala index d24b2c4806..de65fec863 100644 --- a/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala @@ -36,8 +36,11 @@ class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference(ActorSystem.fin getMilliseconds("akka.scheduler.tick-duration") must equal(100) settings.SchedulerTickDuration must equal(100 millis) + getBoolean("akka.daemonic") must be(false) settings.Daemonicity must be(false) - settings.JvmExitOnFatalError must be(true) + + getBoolean("akka.jvm-exit-on-fatal-error") must be(false) + settings.JvmExitOnFatalError must be(false) } { @@ -78,6 +81,32 @@ class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference(ActorSystem.fin getString("task-queue-type") must equal("linked") getBoolean("allow-core-timeout") must equal(true) } + + // Debug config + { + val debug = config.getConfig("akka.actor.debug") + import debug._ + getBoolean("receive") must be(false) + settings.AddLoggingReceive must be(false) + + getBoolean("autoreceive") must be(false) + settings.DebugAutoReceive must be(false) + + getBoolean("lifecycle") must be(false) + settings.DebugLifecycle must be(false) + + getBoolean("fsm") must be(false) + settings.FsmDebugEvent must be(false) + + getBoolean("event-stream") must be(false) + settings.DebugEventStream must be(false) + + getBoolean("unhandled") must be(false) + settings.DebugUnhandledMessage must be(false) + + getBoolean("router-misconfiguration") must be(true) + settings.DebugRouterMisconfiguration must be(true) + } } } } diff --git a/akka-actor/src/main/resources/reference.conf b/akka-actor/src/main/resources/reference.conf index 742b5e86d2..7bedfa3f02 100644 --- a/akka-actor/src/main/resources/reference.conf +++ b/akka-actor/src/main/resources/reference.conf @@ -283,6 +283,9 @@ akka { # enable DEBUG logging of unhandled messages unhandled = off + + # enable WARN logging of misconfigured routers + router-misconfiguration = off } # Entries for pluggable serializers and their bindings. diff --git a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala index bbb84144c5..a5cc26c467 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala @@ -542,6 +542,9 @@ class LocalActorRefProvider( systemService: Boolean, deploy: Option[Deploy], lookupDeploy: Boolean, async: Boolean): InternalActorRef = { props.routerConfig match { case NoRouter ⇒ + if (settings.DebugRouterMisconfiguration && deployer.lookup(path).isDefined) + log.warning("Configuration says that {} should be a router, but code disagrees. Remove the config or add a routerConfig to its Props.") + if (async) new RepointableActorRef(system, props, supervisor, path).initialize() else new LocalActorRef(system, props, supervisor, path) case router ⇒ diff --git a/akka-actor/src/main/scala/akka/actor/ActorSystem.scala b/akka-actor/src/main/scala/akka/actor/ActorSystem.scala index 261a6b3c58..a75e646678 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorSystem.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorSystem.scala @@ -147,6 +147,7 @@ object ActorSystem { final val FsmDebugEvent = getBoolean("akka.actor.debug.fsm") final val DebugEventStream = getBoolean("akka.actor.debug.event-stream") final val DebugUnhandledMessage = getBoolean("akka.actor.debug.unhandled") + final val DebugRouterMisconfiguration = getBoolean("akka.actor.debug.router-misconfiguration") final val Home = config.getString("akka.home") match { case "" ⇒ None diff --git a/akka-actor/src/main/scala/akka/dispatch/Future.scala b/akka-actor/src/main/scala/akka/dispatch/Future.scala index f799322b10..e29f1b8dae 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Future.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Future.scala @@ -127,7 +127,7 @@ object Futures { /** * Java API. - Reduces the results of the supplied futures and binary function. + * Reduces the results of the supplied futures and binary function. */ def reduce[T <: AnyRef, R >: T](futures: JIterable[Future[T]], fun: akka.japi.Function2[R, T, R], executor: ExecutionContext): Future[R] = Future.reduce[T, R](scala.collection.JavaConversions.iterableAsScalaIterable(futures))(fun.apply)(executor)