Code samples in akka documentation not working as expected

For akka documentation,
StartStopActor1 example doesn’t give expected result. Actual output is:

first started
second started
second stopped

Thanks for reporting. This seems to be when it is the root behavior the post stop signal is not executed. I’ve created to investigate

It is more likely because the first actor has replaced its behavior with Behaviors.stopped, which is also the behavior that will then receive the PostStop signal. IIRC there used to be a way to parameterize the stopped behavior to run some code in this case.

The behaviour shouldn’t differ based on whether it’s the guardian behaviour

To me it looks like the guardian difference is a red herring: notice how the first actor responds to a message by replacing its behavior while the second actor does not process any message.

Sorry I wasn’t clear. I’d tried the sample code as a root guradian and as a child of another actor and the behavior differed which needs to be fixed.