From 64bec5658999164829e1c0213e89347f20df4fc8 Mon Sep 17 00:00:00 2001 From: "Brian E. Granger" Date: Mon, 14 Jan 2013 12:14:59 -0800 Subject: [PATCH] Refactoring kernel_died method to make subclass friendly. --- IPython/frontend/html/notebook/handlers.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/IPython/frontend/html/notebook/handlers.py b/IPython/frontend/html/notebook/handlers.py index 457d5429d..68817e250 100644 --- a/IPython/frontend/html/notebook/handlers.py +++ b/IPython/frontend/html/notebook/handlers.py @@ -540,9 +540,13 @@ class IOPubHandler(AuthenticatedZMQStreamHandler): if not self.hb_stream.closed(): self.hb_stream.on_recv(None) - def kernel_died(self): + def _delete_kernel_data(self): + """Remove the kernel data and notebook mapping.""" self.application.kernel_manager.delete_mapping_for_kernel(self.kernel_id) - self.application.log.error("Kernel %s failed to respond to heartbeat", self.kernel_id) + + def kernel_died(self): + self._delete_kernel_data() + self.application.log.error("Kernel died: %s" % self.kernel_id) self.write_message( {'header': {'msg_type': 'status'}, 'parent_header': {},