From 5cfac58873995a1e80712a1e4b9462a28ef84a1f Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 15 Oct 2021 17:54:45 -0400 Subject: [PATCH] Don't pop a child entry that was never inserted --- tractor/_spawn.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tractor/_spawn.py b/tractor/_spawn.py index 1f22310..eb4616c 100644 --- a/tractor/_spawn.py +++ b/tractor/_spawn.py @@ -326,8 +326,11 @@ async def new_proc( await do_hard_kill(proc) log.debug(f"Joined {proc}") - # pop child entry to indicate we no longer managing this subactor - subactor, proc, portal = actor_nursery._children.pop(subactor.uid) + + if not cancelled_during_spawn: + # pop child entry to indicate we no longer managing this + # subactor + actor_nursery._children.pop(subactor.uid) else: # `multiprocessing`