From 561954594ec2f35f5773be7e0bdc087d99c6a91c Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 15 Aug 2025 11:50:17 -0400 Subject: [PATCH] Add attempt at non-root-parent REPL guarding I masked it bc it doesn't seem to actually work for the case I was testing (`emsd` clobbering a `paperboi` in `piker`..) but figured I'd leave it as a reminder for solving this problem more generally (#320) since this is likely the place in the code for a soln. When i tested it in my case it just resulted in a hang around the `with debug.acquire_debug_lock()` for some reason? Can't remember if the child ended up being able to REPL without issue though.. --- tractor/_spawn.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tractor/_spawn.py b/tractor/_spawn.py index 408e793c..8d3c2cf6 100644 --- a/tractor/_spawn.py +++ b/tractor/_spawn.py @@ -297,6 +297,23 @@ async def hard_kill( # zombies (as a feature) we ask the OS to do send in the # removal swad as the last resort. if cs.cancelled_caught: + + # TODO? attempt at intermediary-rent-sub + # with child in debug lock? + # |_https://github.com/goodboy/tractor/issues/320 + # + # if not is_root_process(): + # log.warning( + # 'Attempting to acquire debug-REPL-lock before zombie reap!' + # ) + # with trio.CancelScope(shield=True): + # async with debug.acquire_debug_lock( + # subactor_uid=current_actor().uid, + # ) as _ctx: + # log.warning( + # 'Acquired debug lock, child ready to be killed ??\n' + # ) + # TODO: toss in the skynet-logo face as ascii art? log.critical( # 'Well, the #ZOMBIE_LORD_IS_HERE# to collect\n'