- rewrite deprecated usages to their recommended counterparts
- TestActorRef now verifies mailbox requirements
- CallingThreadMailbox now exposes proper messageQueue type for
inspection
- add “mailbox-requirement” key to dispatcher section
- split out mailbox section, add akka.actor.default-mailbox
- rewrite findMarker method and use it for Props.create() and getting
the required mailbox of an actor
- add ProducesMessageQueue trait for MailboxType so that requirements
can be checked before trying to create the actor for real
- verify actor as well as dispatcher requirements for message queue
before creation, even in remote-deployed case
- change MessageDispatcher constructor to take a Configurator, add that
to migration guide
- Moved system messages to their own package.
- All queueing operations are now hidden behind a SystemMessageList value class
- Introduced dual SystemMessageList types to encode the ordering in the type.
- Protects against accidentally missed reverse calls or accidentally reversed lists
- Makes ordering expectations by fields/parameters explicit
- Fixed serialization tests
- Fixes to logging in HierarchyStressSpec
The problem was that the “waves of actors” test leaves behind lots of
garbage for the CTD to clean up, and its own
CallingThreadDispatcherQueues.gc() then happens to run when the guardian
creates the top-level actor in the following test case, which takes
longer than 3 seconds to run. Fix it by making the GC interval 100ms
instead of 1sec so that the amount of garbage is limited.
Also, replacing .mapValues(...).filter(...) with
.foldLeft(.newBuilder)(...) makes it twice as fast.
And even more so: unregistering mailboxes upon actor termination removes
the cost nearly completely for the “waves of actors” case.
This has brought to light some interesting effects (aka bugs) both in
the general implementation as well as in previous fixes.
SupervisorHierarchySpec is without TODOs now and GREEN.
- always suspend/resume for Suspend/Resume/Recreate, no matter which
state the actor is in, to keep the counter balanced
- preRestart failures are logged but otherwise ignored; there’s nothing
else (apart from terminating the actor) which we could do at that
point
- preRestart/postRestart exceptions have their own distinguishable
subtype of ActorKilledException now
- fix some race conditions in tests to make them produce fewer false
failures
- remove cruft from SupervisorStrategy and add methods which can
actually be used to implement your own (with proper warning signs)
- introducing RepointableActorRef, which starts out with an
UnstartedActorCell which can cheaply be created; the Supervise()
message will trigger child.activate() in the supervisor, which means
that the actual creation (now with normal ActorCell) happens exactly
in the right place and with the right semantics. Messages which were
enqueued to the dummy cell are transferred atomically into the
ActorCell (using normal .tell()), so message sends keep working
exactly as they used to
- this enables getting rid of the brittle synchronization around
RoutedActorRef by replacing that one with a RepointableActorRef
subclass which creates RoutedActorCells upon activate(), with the nice
benefit that there is no hurry then to get it right because the new
cell is constructed “on the side”
misc fixes:
- InvalidMessageException is now actually enforced when trying to send
“null”
- Mailboxes may be created without having an ActorCell, which can come
in handy later, because the cell is only needed when this mailbox is
going to be scheduled on some executor
- remove occurrences of Props(), which is equivalent to Props[Nothing],
which is equivalent to «bug»
- add test case which verifies that context.actorOf is still synchronous
- plus all the stuff I have forgotten.
- this enables using any MessageQueue in BalancingDispatcher,
CallingThreadDispatcher and in general leads to less conflation of
concepts
- add MessageQueue.cleanUp(owner, deadLetterQueue) for the benefit of
durable mailboxes
- change MailboxType.create to take an optional owner and generate only
a MessageQueue, not a Mailbox
split systemDispatch(Create()) into systemEnqueue(Create()) directly
after createMailbox and registerForExecution from within
Dispatcher.attach() (resp. CallingThreadDispatcher.register() does its
own thing)
- add provider, guardian, systemGuardian and deathWatch to it
- make ActorSystemImpl extend ExtendedActorSystem
- use ExtendedActorSystem for creating extensions, thereby limiting the
access extensions get to just those four published methods.
* Changed signatures and constructor of MessageDispatcherConfigurator
* Changed Dispatchers.lookup, keep configurators instead of dispatchers
* Removed most of the Dispatchers.newX methods, newDispatcher is still there because of priority mailbox
* How should we make it easy to configure priority mailbox?
* Changed tons tests
* Documentation and ScalaDoc is not updated yet
* Some tests in ActorModelSpec are temporary ignored due to failure
- 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.