Skip to content

Add more logging to figure out why raw kernel did not start #14374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 12, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ export abstract class InteractiveBase extends WebviewPanelHost<IInteractiveWindo
await this.ensureNotebook(serverConnection);
}
} catch (exc) {
traceError(`Exception attempting to start notebook: `, exc);
// We should dispose ourselves if the load fails. Othewise the user
// updates their install and we just fail again because the load promise is the same.
await this.closeBecauseOfFailure(exc);
Expand Down
2 changes: 2 additions & 0 deletions src/client/datascience/jupyter/jupyterNotebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ export class JupyterNotebookBase implements INotebook {
this.ranInitialSetup = true;
this._workingDirectory = undefined;

traceInfo(`Initial setup for ${this.identity.toString()} starting ...`);

try {
// When we start our notebook initial, change to our workspace or user specified root directory
await this.updateWorkingDirectoryAndPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@ export class HostRawNotebookProvider
notebookMetadata?: nbformat.INotebookMetadata,
cancelToken?: CancellationToken
): Promise<INotebook> {
traceInfo(`Creating raw notebook for ${identity.toString()}`);
const notebookPromise = createDeferred<INotebook>();
this.setNotebook(identity, notebookPromise.promise);

const progressReporter = !disableUI
? this.progressReporter.createProgressIndicator(localize.DataScience.connectingIPyKernel())
: undefined;

traceInfo(`Computing working directory ${identity.toString()}`);
const workingDirectory = await computeWorkingDirectory(resource, this.workspaceService);

const rawSession = new RawJupyterSession(
Expand All @@ -156,6 +158,8 @@ export class HostRawNotebookProvider
try {
const launchTimeout = this.configService.getSettings().datascience.jupyterLaunchTimeout;

traceInfo(`Getting preferred kernel for ${identity.toString()}`);

// We need to locate kernelspec and possible interpreter for this launch based on resource and notebook metadata
const kernelConnectionMetadata = await this.kernelSelector.getPreferredKernelForLocalConnection(
resource,
Expand All @@ -173,6 +177,7 @@ export class HostRawNotebookProvider
) {
notebookPromise.reject('Failed to find a kernelspec to use for ipykernel launch');
} else {
traceInfo(`Connecting to raw session for ${identity.toString()}`);
await rawSession.connect(kernelConnectionMetadata, launchTimeout, cancelToken);

// Get the execution info for our notebook
Expand Down