diff --git a/tractor/_trionics.py b/tractor/_trionics.py index 894ab7d..eea3aae 100644 --- a/tractor/_trionics.py +++ b/tractor/_trionics.py @@ -252,6 +252,12 @@ async def _open_and_supervise_one_cancels_all_nursery( f"Waiting on subactors {anursery._children} " "to complete" ) + + # Last bit before first nursery block ends in the case + # where we didn't error in the caller's scope + log.debug("Waiting on all subactors to complete") + anursery._join_procs.set() + except BaseException as err: # if the caller's scope errored then we activate our # one-cancels-all supervisor strategy (don't @@ -292,11 +298,6 @@ async def _open_and_supervise_one_cancels_all_nursery( else: raise - # Last bit before first nursery block ends in the case - # where we didn't error in the caller's scope - log.debug("Waiting on all subactors to complete") - anursery._join_procs.set() - # ria_nursery scope end # XXX: do we need a `trio.Cancelled` catch here as well?