- AkkaSpecSpec failed with nothing in the locker, but only on Jenkins
- cause: Davy Jones doesn’t get a chance to run because nobody actually
waits for his processing
- thus, give him permission to leave this world and have him confirm
that
- when no name was given, it resulted in a simple call to the provider
- which is completely the wrong thing to do in case of ActorSystem
- so, introduce CreateRandomNameChild op for guardians and use that
The reason for the previously failing test case was that Jenkins has
only two (logical) cores and the test config sets the
core-pool-size-factor to 2, meaning four threads. This is not enough to
have four Futures waiting (as per the test) and one actor which actually
does the work (the guardian in this case). Hence, make it so that
core-pool-size-min gives the absolute minimum and set the default of
that to eight.
While doing so I cleaned up the MessageDispatcherConfigurator to not use
HOF since now configuration items are not optional anymore, yielding a
flow which is much more readily understandable.
- 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_.
* Added JavaActorContext, UntypedActor.getContext
* implicit val context in Actor needs to be implicit to support forward,
it would be nice if it wasn't implicit because now I can't override context
in UntypedActor
* Removed implicit def system in Actor
* Removed implicit def defaultTimeout in Actor
* Removed receiveTimeout, children, dispatcher, become, unbecome, watch,
unwatch in Actor
* Removed corresponding as above from UntypedActor
* Removed implicit from dispatcher in ActorSystem
* Removed implicit def timeout in TypedActor
* Changed receiveTimeout to use Duration (in api)
* Changed many tests and samples to match new api
If automatically generated names contains * and ?, they might do
something strange when being looked up. There was no real issue with our
current tests, but I just want to avoid the issue.
- uncovered nasty endless loop bug wrt. dead letters and a dead listener
- fixing that bug removed the MainBusReaper (sigh)
- also fix compilation of tutorial-first, but that REALLY needs to be
changed not to create RoutedActorRef using new!
Obtaining an ActorRef means that its path must be found in look-ups.
Since this is tightly coupled to supervision, the plan of managing /user
and /system actors in special ConcurrentHashMaps did not succeed: the
actor might not yet be supervised when the system is stopped, which
would orphan it; or a look-up directly following its creation would
return deadLetters. Since all of this is not desirable, I changed the
strategy to sending the props and name to the respective supervisor, let
it create the child and hand it back, i.e. I’m using ask/get with
ActorTimeout. This is okay since top-level should not be created at MHz
rate (will have to document this, though).
- also fix one expected exception in TypedActorSpec and the names of
configured routers
- run closeScheduler upon ActorSystem termination (directly)
- this will execute all outstanding tasks (dispatcher shutdowns have
been queued already, because the last actor has already exited)
- further use of the scheduler (e.g. from tasks just being run) results
in IllegalStateException
- catch such exceptions in DefaultPromise&MessageDispatcher in case of
self-rescheduling tasks and execute final action immediately
- also silently stop recurring tasks
- make “shutdown” a normal boolean
- use lock.readLock() whenever reading “shutdown”
- use lock.writeLock() when setting it to true
- throw IllegalStateException whenever no-queue
- it was telling all children to stop(), then waited for the
ChildTerminated messages and finally terminated itself
- this worked fine, except when the stop came from the supervisor, i.e.
the recipient was suspended and did not process the ChildTerminated
- so, as the mirror of Supervise() that it is, I changed
ChildTerminated() to be a system message and instead of stopping
processing normal messages by checking the stopping flag, just suspend
the actor while awaiting the ChildTerminated's to flow in.
- implementation of this cool feature is now astonishingly simple:
context.actorSelection("child/*") ! msg
- docs propagate to ActorSystem/ActorContext
- look-up of all actor paths in the system, even “synthetic” ones like
“/temp”
- look-up by full URI (akka://bla/...), absolute or relative path
- look-up by ActorPath
- look-up by path elements
- look-up relative to context where applicable, supporting ".."
- proper management of AskActorRef
Have a look at ActorLookupSpec to see what it can do.