Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
A Child Actor not always killed, when its parent is killed #27
Running the code above many times causes leaving processes (htop)
Thank you for your report: there is indeed a timing window where an actor created during the shutdown can get left behind.
The issue is with step 6, and I will get this fixed shortly.
To avoid this problem (even after the fix), I recommend rewriting the Parent as:
Thanks for the link, @pjz.
There's a lot of good background in that post, but Trio is targeting a bit of a different model than an Actor model. At a high level, the
The Trio model is effectively a subset of the Actor model and could be implemented in Thespian (assuming the soon-to-be-added context manager functionality for simplicity):
with appropriate post-determination of which response
[The particular problem @efibutov reported is in the Thespian ActorSystem internals management of the concurrency startup/shutdown sequencing because the Actor model does not block like Trio's does, so this particular problem doesn't necessarily occur in the Trio model (hrm... how does it handle nesting of nursery access?), although there are still plenty of concurrency issues that both have to solve.]
Fixed in release 3.9.3 (https://github.com/kquick/Thespian/releases/tag/thespian-3.9.3). Thank you for the report.