From 1a1700885abc7379ecd55b37249e7a41cb1900b9 2012-06-19 00:52:37 From: MinRK Date: 2012-06-19 00:52:37 Subject: [PATCH] enable graceful restart of kernels in notebook --- diff --git a/IPython/frontend/html/notebook/kernelmanager.py b/IPython/frontend/html/notebook/kernelmanager.py index 3ea27a9..2833d63 100644 --- a/IPython/frontend/html/notebook/kernelmanager.py +++ b/IPython/frontend/html/notebook/kernelmanager.py @@ -43,7 +43,7 @@ class MultiKernelManager(LoggingConfigurable): """A class for managing multiple kernels.""" kernel_manager_class = DottedObjectName( - "IPython.zmq.kernelmanager.KernelManager", config=True, + "IPython.zmq.blockingkernelmanager.BlockingKernelManager", config=True, help="""The kernel manager class. This is configurable to allow subclassing of the KernelManager for customized behavior. """ @@ -87,6 +87,8 @@ class MultiKernelManager(LoggingConfigurable): config=self.config, ) km.start_kernel(**kwargs) + # start the shell channel, needed for graceful restart + km.start_channels(shell=True, sub=False, stdin=False, hb=False) self._kernels[kernel_id] = km return kernel_id @@ -284,7 +286,7 @@ class MappingKernelManager(MultiKernelManager): """Restart a kernel while keeping clients connected.""" self._check_kernel_id(kernel_id) km = self.get_kernel(kernel_id) - km.restart_kernel(now=True) + km.restart_kernel() self.log.info("Kernel restarted: %s" % kernel_id) return kernel_id