Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions news/2 Fixes/9926.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use the autoStart server when available.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to update the changelog

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rich Chiodo (@rchiodo) . Did we change the process? I didn't do this on previous release ports, thought that it was generated by running 'news' task as part of the final release plan.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think other people have started running the task during their port? Karthik Nadig (@karthiknadig) should we update the changelog when porting fixes?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like that's what David did here:
https://github.com/microsoft/vscode-python/pull/9912/files

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, guess I can do that. Seems like that would mess up the cherry-pick since that has the news file in it. But I could just delete that as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Via Karthik it sounds like we can do either. But I was already updating the CL, so I just went ahead with it.

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