File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -310,23 +310,23 @@ async def shutdown_units() -> None:
310310 unit .shutdown () # type: ignore
311311
312312 shutdown_future = asyncio .run_coroutine_threadsafe (shutdown_units (), loop = loop )
313- while True :
314- try :
315- shutdown_future . result ()
316- break
317- except KeyboardInterrupt :
318- ...
313+ try :
314+ shutdown_future . result ( timeout = 10.0 )
315+ except KeyboardInterrupt :
316+ shutdown_future . result ()
317+ except TimeoutError :
318+ logger . warning ( "Timed out waiting for unit shutdown" )
319319
320320 # for cache in MessageCache.values():
321321 # cache.clear()
322322
323323 revert_future = asyncio .run_coroutine_threadsafe (context .revert (), loop = loop )
324- while True :
325- try :
326- revert_future . result ()
327- break
328- except KeyboardInterrupt :
329- ...
324+ try :
325+ revert_future . result ( timeout = 10.0 )
326+ except KeyboardInterrupt :
327+ revert_future . result ()
328+ except TimeoutError :
329+ logger . warning ( "Timed out waiting for context revert" )
330330
331331 logger .debug (f"Remaining tasks in event loop = { asyncio .all_tasks (loop )} " )
332332
You can’t perform that action at this time.
0 commit comments