forked from goodboy/tractor
Re-raise KBI's i guess?
parent
5df08aabb7
commit
5048c3534f
|
@ -282,6 +282,7 @@ async def _open_and_supervise_one_cancels_all_nursery(
|
||||||
|
|
||||||
# after daemon nursery exit
|
# after daemon nursery exit
|
||||||
finally:
|
finally:
|
||||||
|
log.cancel(f'Waiting on remaining children {anursery._children}')
|
||||||
with trio.CancelScope(shield=True):
|
with trio.CancelScope(shield=True):
|
||||||
await anursery._all_children_reaped.wait()
|
await anursery._all_children_reaped.wait()
|
||||||
# No errors were raised while awaiting ".run_in_actor()"
|
# No errors were raised while awaiting ".run_in_actor()"
|
||||||
|
@ -302,11 +303,12 @@ async def _open_and_supervise_one_cancels_all_nursery(
|
||||||
else:
|
else:
|
||||||
raise list(errors.values())[0]
|
raise list(errors.values())[0]
|
||||||
|
|
||||||
elif original_err:
|
|
||||||
raise original_err
|
|
||||||
|
|
||||||
log.cancel(f'{anursery} terminated gracefully')
|
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
|
@asynccontextmanager
|
||||||
async def open_nursery(
|
async def open_nursery(
|
||||||
|
|
Loading…
Reference in New Issue