Child actors not being terminated after their parent exits

23 views
Skip to first unread message

dendron2000

unread,
Mar 27, 2022, 2:08:15 PM3/27/22
to thespian.py
Hi,

I have noticed that in the case of multiprocTCPBase system the child actors' processes created by the parent are not getting killed after the latter exits. This is despite what the documentation says. I have tried modyfying the source code of thespian itself by supplying "daemon=True" to the Process() constructor but this did not help. Basically, each time I run my program I have a couple of those extra child processes being accumulated. Is this a known bug?

E

unread,
Jul 12, 2022, 11:17:17 AM7/12/22
to thespian.py
The way I solved this problem was to call asys.shutdown() on exit.  I do this by capturing KeyboardInterrupt and calling asys.shutdown().  A try finally might also work.  I don't recommend the time.sleep but I am still trying to wrap my head around this.

asys = ActorSystem("multiprocTCPBase")
try:
    asys.createActor(Server, globalName="Server")
    while True:
        time.sleep(0.2)
except KeyboardInterrupt:
    asys.shutdown()
Reply all
Reply to author
Forward
0 new messages