From bb8bace1cbf70f3a7d96aaf71aa2ef51954e2dad Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Thu, 6 Feb 2020 11:26:51 -0800 Subject: [PATCH 1/2] Do not override kernels info in other notebooks --- .../datascience/jupyter/liveshare/hostJupyterServer.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/datascience/jupyter/liveshare/hostJupyterServer.ts b/src/client/datascience/jupyter/liveshare/hostJupyterServer.ts index cec3de412ca8..928f913686ca 100644 --- a/src/client/datascience/jupyter/liveshare/hostJupyterServer.ts +++ b/src/client/datascience/jupyter/liveshare/hostJupyterServer.ts @@ -158,10 +158,15 @@ export class HostJupyterServer extends LiveShareParticipantHost(JupyterServerBas // Otherwise create a new notebook. // First we need our launch information so we can start a new session (that's what our notebook is really) - const launchInfo = await this.waitForConnect(); + let launchInfo = await this.waitForConnect(); if (!launchInfo) { throw this.getDisposedError(); } + // Create a copy of launch info, cuz we're modifying it here. + // Probably need a better structure than using a simple dict. + launchInfo = { + ...launchInfo + }; // Find a kernel that can be used. // Do this only if kernel information has been provided in the metadata, else use the default. From a15a8f0b134e77592afca78772c73b28bc2fd6d5 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Thu, 6 Feb 2020 11:31:12 -0800 Subject: [PATCH 2/2] Fixes --- src/client/datascience/jupyter/liveshare/hostJupyterServer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/datascience/jupyter/liveshare/hostJupyterServer.ts b/src/client/datascience/jupyter/liveshare/hostJupyterServer.ts index 928f913686ca..e893f12a0c90 100644 --- a/src/client/datascience/jupyter/liveshare/hostJupyterServer.ts +++ b/src/client/datascience/jupyter/liveshare/hostJupyterServer.ts @@ -163,7 +163,8 @@ export class HostJupyterServer extends LiveShareParticipantHost(JupyterServerBas throw this.getDisposedError(); } // Create a copy of launch info, cuz we're modifying it here. - // Probably need a better structure than using a simple dict. + // This launch info contains the server connection info (that could be shared across other nbs). + // However the kernel info is different. The kernel info is stored as a property of this, hence create a separate instance for each nb. launchInfo = { ...launchInfo };