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 c398586e78..f87186348f 100644 --- a/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala @@ -38,8 +38,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) } { @@ -80,6 +83,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 3c5f57a2d8..6b5f6baeaa 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 54d0870d18..85507ebcb8 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorSystem.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorSystem.scala @@ -148,6 +148,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 2655dfb226..6d94449020 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Future.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Future.scala @@ -63,7 +63,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) diff --git a/akka-docs/java/routing.rst b/akka-docs/java/routing.rst index 16aa4cee6f..16858bc896 100644 --- a/akka-docs/java/routing.rst +++ b/akka-docs/java/routing.rst @@ -33,10 +33,13 @@ You can also give the router already created routees as in: .. includecode:: code/docs/jrouting/RouterViaProgramExample.java#programmaticRoutingRoutees -It should be noted that no actor factory or class needs to be provided in this -case, as the ``Router`` will not create any children on its own (which is not -true anymore when using a resizer). The routees can also be specified by giving -their path strings. +.. note:: + + No actor factory or class needs to be provided in this + case, as the ``Router`` will not create any children on its own (which is not + true anymore when using a resizer). The routees can also be specified by giving + their path strings. + When you create a router programmatically you define the number of routees *or* you pass already created routees to it. If you send both parameters to the router *only* the latter will be used, i.e. ``nrOfInstances`` is disregarded. diff --git a/akka-docs/scala/routing.rst b/akka-docs/scala/routing.rst index 5a37b3471a..a0bbe37089 100644 --- a/akka-docs/scala/routing.rst +++ b/akka-docs/scala/routing.rst @@ -33,10 +33,13 @@ You can also give the router already created routees as in: .. includecode:: code/docs/routing/RouterViaProgramExample.scala#programmaticRoutingRoutees -It should be noted that no actor factory or class needs to be provided in this -case, as the ``Router`` will not create any children on its own (which is not -true anymore when using a resizer). The routees can also be specified by giving -their path strings. +.. note:: + + No actor factory or class needs to be provided in this + case, as the ``Router`` will not create any children on its own (which is not + true anymore when using a resizer). The routees can also be specified by giving + their path strings. + When you create a router programmatically you define the number of routees *or* you pass already created routees to it. If you send both parameters to the router *only* the latter will be used, i.e. ``nrOfInstances`` is disregarded.