akkadotnet/akka.net — pull request #495 by HCanber (2014-11-09 18:20:08+00:00)
Title: SupervisorHierarchySpec #324

This PR adds almost all tests in the `SupervisorHierarchySpec`:

- A supervisor hierarchy must Restart Manager And Workers In AllForOne
- A supervisor hierarchy must send notifications to supervisor when permanent failure
- A supervisor hierarchy must resume children after Resume
- A supervisor hierarchy must suspend children while failing
- A supervisor hierarchy must handle failure in creation when supervision strategy returns Resume and Restart

What's not included is the stress test. It's very much code to write for that one so I'm skipping it for now. This is a rather hefty PR as it is. :(
The tests passes. They wouldn't pass if they were implemented against today's code, so this is an important update.

This PR implements almost everything in `dungeon/FaultHandling.scala`. Some todos left. What differs is handling `ActorSystem.Abort` (which we don't have right now) and some differences in `FinishTerminate()` due to differences in the dispatcher (but all the functionality is there).

The commits can be divided it into two chunks:

__First chunk__ contains new code and minor changes, and should be pretty straight forward to review.
- First three omits only adds new code, without using it.
- https://github.com/HCanber/akka.net/commit/97bd231a70716f449dc109e84423328ee92533f7 __Add Immutable AVL Trees__
- https://github.com/HCanber/akka.net/commit/5e7230dd1ea32602b9128e406fd053b3d0d2aa24 __Add ChildrenContainer__
- https://github.com/HCanber/akka.net/commit/f481bc2ae04c4b9c666f63f9e20e79aa70929ece __Add CAS helper methods for transforming values atomically__

- The next three commits contains minor changes or brand new functionality.
- https://github.com/HCanber/akka.net/commit/8a406263058312913423a0a17d5f9d6d63fb3a2d __Make it possible to check inner exceptions when filtering exceptions in TestKit__ Non breaking change
- https://github.com/HCanber/akka.net/commit/f0f79bbe622a4444e4794d0b4cacc5aa0d1d71c2 __Add overload to inline actors that forwards the Actor Context to the config function__ New functionality that makes it possible to create child actors in inline actors, i.e. `ActorOf((dsl,ctx) => { ctx.ActorOf(..., "child"); ... })`
- https://github.com/HCanber/akka.net/commit/6ecc1e67161075bca2e9f876f8f37ffcca1c0cc8 __Change property IAtomicCounter.Next to to a function__. The debugger calls properties automatically so the value was increased when debugging. This changes it to a function instead. It is a breaking change but to the internal api only.

__Second chunk__
The rest of the commits is the new functionality and rewrites/implements `FaultHandling`.
The methods `HandleFailure` and `ProcessFailure` in the abstract class `SupervisorStrategy` has new signatures. If you've inherited from SupervisorStrategy, OneForOneStrategy or AllForOneStrategy and overriden the aforementioned methods you need to update their signatures. Probably very few, if any, have modified these classes so I think it has very low impact.

Breaking changes has been added to ReleaseNotes. See https://github.com/HCanber/akka.net/blob/5d0f361bdfa9cb6e2ff46384e73dfd793ba7f813/RELEASE_NOTES.md

I really don't like these large PR:s. If you want, and have an idea how, I can split this into smaller PR:s. Would it be easier if I for example split it into three PR:s, as outlined above? I.e. get the smaller changes in by itself, and then have the second chunk as a separate PR?