From aaa7321d5cf161da476fe13dabb6a0ff31b84e2d Mon Sep 17 00:00:00 2001 From: Hendrik Makait Date: Thu, 12 May 2022 18:04:46 +0200 Subject: [PATCH] Re-raise exception in `dask_scheduler.py` Co-authored-by: Thomas Grainger --- distributed/cli/dask_scheduler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/distributed/cli/dask_scheduler.py b/distributed/cli/dask_scheduler.py index 94d82a44395..700765ba6fe 100755 --- a/distributed/cli/dask_scheduler.py +++ b/distributed/cli/dask_scheduler.py @@ -218,10 +218,12 @@ async def wait_for_signals_and_close(): wait_for_scheduler_to_finish() ) - await asyncio.wait( + done, _ = await asyncio.wait( [wait_for_signals_and_close_task, wait_for_scheduler_to_finish_task], return_when=asyncio.FIRST_COMPLETED, ) + # Re-raise exceptions from done tasks + [task.result() for task in done] logger.info("Stopped scheduler at %r", scheduler.address) try: