diff --git a/notebook/services/kernels/kernelmanager.py b/notebook/services/kernels/kernelmanager.py index 2c3f2aeebf..f3152c47c5 100644 --- a/notebook/services/kernels/kernelmanager.py +++ b/notebook/services/kernels/kernelmanager.py @@ -390,7 +390,7 @@ def shutdown_kernel(self, kernel_id, now=False): self._check_kernel_id(kernel_id) kernel = self._kernels.pop(kernel_id) self.log.info("Shutting down kernel %s", kernel_id) - yield kernel.shutdown() + yield kernel.shutdown(now=now) self.last_kernel_activity = utcnow() # Decrease the metric of number of kernels @@ -545,4 +545,4 @@ def cull_kernel_if_idle(self, kernel_id): idle_duration = int(dt_idle.total_seconds()) self.log.warning("Culling '%s' kernel '%s' (%s) with %d connections due to %s seconds of inactivity.", kernel.execution_state, kernel.kernel_type, kernel_id, connections, idle_duration) - kernel.shutdown() + self.shutdown_kernel(kernel_id, now=True)