diff --git a/akka-actor-tests/src/test/scala/akka/performance/workbench/BenchmarkConfig.scala b/akka-actor-tests/src/test/scala/akka/performance/workbench/BenchmarkConfig.scala index dfd9171fd0..11ed21c9aa 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/workbench/BenchmarkConfig.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/workbench/BenchmarkConfig.scala @@ -14,7 +14,7 @@ object BenchmarkConfig { maxClients = 4 repeatFactor = 2 timeDilation = 1 - maxRunDuration = 10 seconds + maxRunDuration = 20 seconds clientDelay = 250000 nanoseconds logResult = true resultDir = "target/benchmark" diff --git a/akka-actor/src/main/scala/akka/actor/Props.scala b/akka-actor/src/main/scala/akka/actor/Props.scala index e7eba69bdf..0a032408a2 100644 --- a/akka-actor/src/main/scala/akka/actor/Props.scala +++ b/akka-actor/src/main/scala/akka/actor/Props.scala @@ -21,7 +21,6 @@ object Props { import FaultHandlingStrategy._ final val defaultCreator: () ⇒ Actor = () ⇒ throw new UnsupportedOperationException("No actor creator specified!") - final val defaultDispatcherId: String = null final val defaultTimeout: Timeout = Timeout(Duration.MinusInf) final val defaultDecider: Decider = { case _: ActorInitializationException ⇒ Stop @@ -125,7 +124,7 @@ object Props { */ case class Props( creator: () ⇒ Actor = Props.defaultCreator, - dispatcher: String = Props.defaultDispatcherId, + dispatcher: String = Dispatchers.DefaultDispatcherId, timeout: Timeout = Props.defaultTimeout, faultHandler: FaultHandlingStrategy = Props.defaultFaultHandler, routerConfig: RouterConfig = Props.defaultRoutedProps) { @@ -135,7 +134,7 @@ case class Props( */ def this() = this( creator = Props.defaultCreator, - dispatcher = Props.defaultDispatcherId, + dispatcher = Dispatchers.DefaultDispatcherId, timeout = Props.defaultTimeout, faultHandler = Props.defaultFaultHandler) @@ -144,7 +143,7 @@ case class Props( */ def this(factory: UntypedActorFactory) = this( creator = () ⇒ factory.create(), - dispatcher = Props.defaultDispatcherId, + dispatcher = Dispatchers.DefaultDispatcherId, timeout = Props.defaultTimeout, faultHandler = Props.defaultFaultHandler) @@ -153,7 +152,7 @@ case class Props( */ def this(actorClass: Class[_ <: Actor]) = this( creator = () ⇒ actorClass.newInstance, - dispatcher = Props.defaultDispatcherId, + dispatcher = Dispatchers.DefaultDispatcherId, timeout = Props.defaultTimeout, faultHandler = Props.defaultFaultHandler, routerConfig = Props.defaultRoutedProps) diff --git a/akka-actor/src/main/scala/akka/dispatch/Dispatchers.scala b/akka-actor/src/main/scala/akka/dispatch/Dispatchers.scala index 04784f151c..5abdd32438 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Dispatchers.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Dispatchers.scala @@ -69,24 +69,23 @@ class Dispatchers(val settings: ActorSystem.Settings, val prerequisites: Dispatc def lookup(id: String): MessageDispatcher = lookupConfigurator(id).dispatcher() private def lookupConfigurator(id: String): MessageDispatcherConfigurator = { - val lookupId = if (id == Props.defaultDispatcherId) DefaultDispatcherId else id - dispatcherConfigurators.get(lookupId) match { + dispatcherConfigurators.get(id) match { case null ⇒ // It doesn't matter if we create a dispatcher configurator that isn't used due to concurrent lookup. // That shouldn't happen often and in case it does the actual ExecutorService isn't // created until used, i.e. cheap. val newConfigurator = - if (settings.config.hasPath(lookupId)) { - configuratorFrom(config(lookupId)) + if (settings.config.hasPath(id)) { + configuratorFrom(config(id)) } else { // Note that the configurator of the default dispatcher will be registered for this id, // so this will only be logged once, which is crucial. prerequisites.eventStream.publish(Warning("Dispatchers", - "Dispatcher [%s] not configured, using default-dispatcher".format(lookupId))) + "Dispatcher [%s] not configured, using default-dispatcher".format(id))) lookupConfigurator(DefaultDispatcherId) } - dispatcherConfigurators.putIfAbsent(lookupId, newConfigurator) match { + dispatcherConfigurators.putIfAbsent(id, newConfigurator) match { case null ⇒ newConfigurator case existing ⇒ existing }