forked from goodboy/tractor
1
0
Fork 0

Move join event trigger to direct exit path

round_2_ci_windows
Tyler Goodlet 2021-07-05 13:37:09 -04:00
parent b1cd7fdedf
commit 98bbf8e0df
1 changed files with 6 additions and 5 deletions

View File

@ -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?