From 5048c3534fd319cbe64e1b7d54b087e9ae983199 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 8 Oct 2021 21:01:51 -0400 Subject: [PATCH] Re-raise KBI's i guess? --- tractor/_supervise.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tractor/_supervise.py b/tractor/_supervise.py index 921c121..c4532b9 100644 --- a/tractor/_supervise.py +++ b/tractor/_supervise.py @@ -282,6 +282,7 @@ async def _open_and_supervise_one_cancels_all_nursery( # after daemon nursery exit finally: + log.cancel(f'Waiting on remaining children {anursery._children}') with trio.CancelScope(shield=True): await anursery._all_children_reaped.wait() # No errors were raised while awaiting ".run_in_actor()" @@ -302,11 +303,12 @@ async def _open_and_supervise_one_cancels_all_nursery( else: raise list(errors.values())[0] - elif original_err: - raise original_err - log.cancel(f'{anursery} terminated gracefully') + # XXX" honestly no idea why this is needed but sure.. + if isinstance(original_err, KeyboardInterrupt) and anursery.cancelled: + raise original_err + @asynccontextmanager async def open_nursery(