Skip to content

Commit

Permalink
Make iostream shutdown more robust (#1143)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Sep 4, 2023
1 parent ca79e2e commit 9d3f7ae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ipykernel/iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ def _start_event_gc():
async def _cancel():
self._event_pipe_gc_task.cancel() # type:ignore

try:
if not self._stopped:
self.io_loop.run_sync(_cancel)
except TimeoutError:
pass
else:
self._event_pipe_gc_task.cancel()

self.io_loop.close(all_fds=True)

def _setup_event_pipe(self):
Expand Down

0 comments on commit 9d3f7ae

Please sign in to comment.