From e8b6e655637f86bf286dbdaa88a51df08ccceed3 Mon Sep 17 00:00:00 2001 From: Grant Nestor Date: Tue, 9 Aug 2016 18:22:01 -0700 Subject: [PATCH 1/2] If kernel is broken, start a new session --- notebook/static/notebook/js/notebook.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebook/static/notebook/js/notebook.js b/notebook/static/notebook/js/notebook.js index 9f0404c79..58b2d7c2e 100644 --- a/notebook/static/notebook/js/notebook.js +++ b/notebook/static/notebook/js/notebook.js @@ -2073,7 +2073,7 @@ import {ShortcutEditor} from 'notebook/js/shortcuteditor'; var success = $.proxy(this._session_started, this); var failure = $.proxy(this._session_start_failed, this); - if (this.session !== null) { + if (this.session && this.session.kernel) { this.session.restart(options, success, failure); } else { this.session = new session.Session(options); From 2b7ce12e74c0ce33e3ad78f4f0f8896ead60cee3 Mon Sep 17 00:00:00 2001 From: Grant Nestor Date: Fri, 12 Aug 2016 13:08:06 -0700 Subject: [PATCH 2/2] Always start a new session on switch kernel --- notebook/static/notebook/js/notebook.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/notebook/static/notebook/js/notebook.js b/notebook/static/notebook/js/notebook.js index 58b2d7c2e..2069c81fb 100644 --- a/notebook/static/notebook/js/notebook.js +++ b/notebook/static/notebook/js/notebook.js @@ -254,10 +254,8 @@ import {ShortcutEditor} from 'notebook/js/shortcuteditor'; if (!existing_spec || ! _.isEqual(existing_spec, that.metadata.kernelspec)) { that.set_dirty(true); } - // start session if the current session isn't already correct - if (!(that.session && that.session.kernel && that.session.kernel.name === data.name)) { - that.start_session(data.name); - } + // start a new session + that.start_session(data.name); }); this.events.on('kernel_ready.Kernel', function(event, data) {