Skip to content

Commit

Permalink
support async kernel shutdown
Browse files Browse the repository at this point in the history
This is an "add-on" commit to PR jupyter#4412 in which kernel startup was
addressed.
  • Loading branch information
kevin-bates committed Feb 25, 2019
1 parent d145301 commit b8fc8cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion notebook/services/kernels/kernelmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def stop_buffering(self, kernel_id):
self.log.info("Discarding %s buffered messages for %s",
len(msg_buffer), buffer_info['session_key'])

@gen.coroutine
def shutdown_kernel(self, kernel_id, now=False):
"""Shutdown a kernel by kernel_id"""
self._check_kernel_id(kernel_id)
Expand All @@ -300,7 +301,8 @@ def shutdown_kernel(self, kernel_id, now=False):
type=self._kernels[kernel_id].kernel_name
).dec()

return super(MappingKernelManager, self).shutdown_kernel(kernel_id, now=now)
ret = yield gen.maybe_future(super(MappingKernelManager, self).shutdown_kernel(kernel_id, now=now))
raise gen.Return(ret)

@gen.coroutine
def restart_kernel(self, kernel_id):
Expand Down

0 comments on commit b8fc8cb

Please sign in to comment.