introduce akka.actor.creation-timeout to make Jenkins happy

- I had reused akka.actor.timeout for ActorSystem.actorOf calls (which
  “ask” the guardian to create the actor), but 5sec proved too short for
  Jenkins
- CreationTimeout defaults to 30sec now, let’s hope Jenkins is not
  slower than _that_.
This commit is contained in:
Roland 2011-12-06 16:27:10 +01:00
parent 66c1d62a51
commit d6fc97c48d
4 changed files with 20 additions and 16 deletions

View file

@ -36,6 +36,7 @@ akka {
actor {
provider = "akka.actor.LocalActorRefProvider"
creation-timeout = 20s # Timeout for ActorSystem.actorOf
timeout = 5s # Default timeout for Future based invocations
# - Actor: ask && ?
# - UntypedActor: ask

View file

@ -71,6 +71,7 @@ object ActorSystem {
val ProviderClass = getString("akka.actor.provider")
val CreationTimeout = Timeout(Duration(getMilliseconds("akka.actor.creation-timeout"), MILLISECONDS))
val ActorTimeout = Timeout(Duration(getMilliseconds("akka.actor.timeout"), MILLISECONDS))
val SerializeAllMessages = getBoolean("akka.actor.serialize-messages")
@ -300,19 +301,21 @@ class ActorSystemImpl(val name: String, applicationConfig: Config) extends Actor
protected def systemImpl = this
implicit def timeout = settings.ActorTimeout
private[akka] def systemActorOf(props: Props, name: String): ActorRef =
private[akka] def systemActorOf(props: Props, name: String): ActorRef = {
implicit val timeout = settings.CreationTimeout
(systemGuardian ? CreateChild(props, name)).get match {
case ref: ActorRef ref
case ex: Exception throw ex
}
}
def actorOf(props: Props, name: String): ActorRef =
def actorOf(props: Props, name: String): ActorRef = {
implicit val timeout = settings.CreationTimeout
(guardian ? CreateChild(props, name)).get match {
case ref: ActorRef ref
case ex: Exception throw ex
}
}
import settings._

View file

@ -14,15 +14,15 @@ package akka.actor
import akka.util.Duration
/**
* An Akka scheduler service. This one needs one special behavior: if
* Closeable, it MUST execute all outstanding tasks upon .close() in order
* to properly shutdown all dispatchers.
*
* Furthermore, this timer service MUST throw IllegalStateException if it
* cannot schedule a task. Once scheduled, the task MUST be executed. If
* executed upon close(), the task may execute before its timeout.
*/
/**
* An Akka scheduler service. This one needs one special behavior: if
* Closeable, it MUST execute all outstanding tasks upon .close() in order
* to properly shutdown all dispatchers.
*
* Furthermore, this timer service MUST throw IllegalStateException if it
* cannot schedule a task. Once scheduled, the task MUST be executed. If
* executed upon close(), the task may execute before its timeout.
*/
trait Scheduler {
/**
* Schedules a message to be sent repeatedly with an initial delay and frequency.