Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

### Fixes

1. Use the autoStart server when available.
([#9926](https://github.com/Microsoft/vscode-python/issues/9926))
1. Removed unnecessary warning when executing cells that use Scrapbook,
Fix an html crash when using not supported mime types
([#9796](https://github.com/microsoft/vscode-python/issues/9796))
Expand Down
11 changes: 9 additions & 2 deletions src/client/datascience/jupyter/liveshare/serverCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface IServerData {
options: INotebookServerOptions;
promise: Promise<INotebookServer | undefined>;
cancelSource: CancellationTokenSource;
resolved: boolean;
}

export class ServerCache implements IAsyncDisposable {
Expand All @@ -43,7 +44,7 @@ export class ServerCache implements IAsyncDisposable {

// See if the old options had the same UI setting. If not,
// cancel the old
if (data && data.options.disableUI !== fixedOptions.disableUI) {
if (data && !data.resolved && data.options.disableUI !== fixedOptions.disableUI) {
traceInfo('Cancelling server create as UI state has changed');
data.cancelSource.cancel();
data = undefined;
Expand All @@ -55,7 +56,8 @@ export class ServerCache implements IAsyncDisposable {
data = {
promise: createFunction(options, cancelSource.token),
options: fixedOptions,
cancelSource
cancelSource,
resolved: false
};
this.cache.set(key, data);
}
Expand All @@ -75,6 +77,11 @@ export class ServerCache implements IAsyncDisposable {
return oldDispose();
};

// We've resolved the promise at this point
if (data) {
data.resolved = true;
}

return server;
})
.catch(e => {
Expand Down