Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
50e9b54
Fix stack trace issues
rchiodo Jul 10, 2019
3d7b8d5
Attempt to fix restart issues with restart kernel.
rchiodo Jul 10, 2019
ceddc34
Add async dump for long running test
rchiodo Jul 10, 2019
5a0c405
Fix loop for session
rchiodo Jul 10, 2019
35f589f
Merge remote-tracking branch 'origin/master' into rchiodo/debugger_ni…
rchiodo Jul 10, 2019
1f179e5
Try waiting longer for shutdown
rchiodo Jul 10, 2019
f1c7eac
Put async dump back the way it was before.
rchiodo Jul 10, 2019
0beab00
Use pypi to install ptvsd
rchiodo Jul 10, 2019
5835c9d
Add more logging
rchiodo Jul 10, 2019
391cc98
More logging
rchiodo Jul 11, 2019
053d41e
More logging
rchiodo Jul 11, 2019
c379710
Just run functional tests
rchiodo Jul 11, 2019
ad03953
Merge remote-tracking branch 'origin/master' into rchiodo/debugger_ni…
rchiodo Jul 11, 2019
ce2816a
Merge remote-tracking branch 'origin/master' into rchiodo/debugger_ni…
rchiodo Jul 11, 2019
f9a2362
Remote ready session work. Only wait for ready on restart.
rchiodo Jul 11, 2019
efcdc46
Fix debugger tests. Try not shutting down during restart
rchiodo Jul 11, 2019
0131a32
More logging
rchiodo Jul 11, 2019
c79d99e
Put off restart session
rchiodo Jul 12, 2019
8b7c3cb
Add some more logging
rchiodo Jul 12, 2019
b4c79f3
More logging
rchiodo Jul 12, 2019
688fcf0
More logging
rchiodo Jul 12, 2019
454a945
Fix restart bug
rchiodo Jul 12, 2019
60bd05b
More logging
rchiodo Jul 12, 2019
69d8ecb
Linter errors
rchiodo Jul 12, 2019
c9d9b65
Loop for idle for restart
rchiodo Jul 12, 2019
05b7ef7
Fix linter errors
rchiodo Jul 12, 2019
47dfc5a
Merge from master
rchiodo Jul 15, 2019
e21dff9
Let ptvsd be installed
rchiodo Jul 15, 2019
b18222f
Update package-lock
rchiodo Jul 15, 2019
2167246
Remove some logging
rchiodo Jul 15, 2019
0403199
Put ptvsd back in the functional requirements. Installer isn't working
rchiodo Jul 15, 2019
9acdbc9
Remove some logging and put back full nightly
rchiodo Jul 15, 2019
c264909
Remove some logging
rchiodo Jul 15, 2019
628f2c7
Up timeout to 90 minutes
rchiodo Jul 15, 2019
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 build/ci/templates/test_phases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ steps:
python -m pip install -U pip
python -m pip install numpy
python -m pip install --upgrade -r ./build/functional-test-requirements.txt
python -m pip install --upgrade --pre ptvsd

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ptvsd [](start = 44, length = 5)

Ian you should be able to remove this once you fix the install bug.

displayName: 'pip install functional requirements'
condition: and(succeeded(), eq(variables['NeedsPythonFunctionalReqs'], 'true'))

Expand Down
2 changes: 1 addition & 1 deletion build/ci/vscode-python-nightly-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# ignorePythonVersions: "3.6,3.5"

- job: 'Nightly'

timeoutInMinutes: 90
strategy:
matrix:
# Each member of this list must contain these values:
Expand Down
2 changes: 1 addition & 1 deletion build/functional-test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ jupyter
numpy
matplotlib
pandas
livelossplot
livelossplot
52 changes: 26 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 24 additions & 5 deletions src/client/datascience/jupyter/jupyterServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { CancellationToken } from 'vscode-jsonrpc';

import { ILiveShareApi } from '../../common/application/types';
import { Cancellation, CancellationError } from '../../common/cancellation';
import { traceInfo, traceWarning } from '../../common/logger';
import { traceError, traceInfo, traceWarning } from '../../common/logger';
import { IAsyncDisposableRegistry, IConfigurationService, IDisposableRegistry, ILogger } from '../../common/types';
import { createDeferred, Deferred, waitForPromise } from '../../common/utils/async';
import * as localize from '../../common/utils/localize';
Expand Down Expand Up @@ -44,17 +44,21 @@ class CellSubscriber {
private cellRef: ICell;
private subscriber: Subscriber<ICell>;
private promiseComplete: (self: CellSubscriber) => void;
private startTime: number;
private _startTime: number;

constructor(cell: ICell, subscriber: Subscriber<ICell>, promiseComplete: (self: CellSubscriber) => void) {
this.cellRef = cell;
this.subscriber = subscriber;
this.promiseComplete = promiseComplete;
this.startTime = Date.now();
this._startTime = Date.now();
}

public get startTime(): number {
return this._startTime;
}

public isValid(sessionStartTime: number | undefined) {
return sessionStartTime && this.startTime > sessionStartTime;
return sessionStartTime && this.startTime >= sessionStartTime;
}

public next(sessionStartTime: number | undefined) {
Expand Down Expand Up @@ -305,15 +309,19 @@ export class JupyterServerBase implements INotebookServer {
// Update our start time so we don't keep sending responses
this.sessionStartTime = Date.now();

traceInfo('restartKernel - finishing cells that are outstanding');
// Complete all pending as an error. We're restarting
this.finishUncompletedCells();
traceInfo('restartKernel - restarting kernel');

// Restart our kernel
await this.session.restart(timeoutMs);

// Rerun our initial setup for the notebook
this.ranInitialSetup = false;
traceInfo('restartKernel - initialSetup');
await this.initialNotebookSetup();
traceInfo('restartKernel - initialSetup completed');

return;
}
Expand Down Expand Up @@ -531,6 +539,8 @@ export class JupyterServerBase implements INotebookServer {
}
}

traceError('No session during execute observable');

// Can't run because no session
return new Observable<ICell[]>(subscriber => {
subscriber.error(this.getDisposedError());
Expand All @@ -539,7 +549,7 @@ export class JupyterServerBase implements INotebookServer {
}

private generateRequest = (code: string, silent?: boolean): Kernel.IFuture | undefined => {
//this.logger.logInformation(`Executing code in jupyter : ${code}`)
//traceInfo(`Executing code in jupyter : ${code}`);
try {
const cellMatcher = new CellMatcher(this.configService.getSettings().datascience);
return this.session ? this.session.requestExecute(
Expand All @@ -563,25 +573,29 @@ export class JupyterServerBase implements INotebookServer {
// Set up our initial plotting and imports
private async initialNotebookSetup(cancelToken?: CancellationToken): Promise<void> {
if (this.ranInitialSetup) {
traceInfo(`Already ran setup for ${this.id}`);
return;
}
this.ranInitialSetup = true;

try {
// When we start our notebook initial, change to our workspace or user specified root directory
if (this.launchInfo && this.launchInfo.workingDir && this.launchInfo.connectionInfo.localLaunch) {
traceInfo(`Changing directory for ${this.id}`);
await this.changeDirectoryIfPossible(this.launchInfo.workingDir);
}

const settings = this.configService.getSettings().datascience;
const matplobInit = !settings || settings.enablePlotViewer ? CodeSnippits.MatplotLibInitSvg : CodeSnippits.MatplotLibInitPng;

traceInfo(`Initialize matplotlib for ${this.id}`);
// Force matplotlib to inline and save the default style. We'll use this later if we
// get a request to update style
await this.executeSilently(
matplobInit,
cancelToken
);
traceInfo(`Initial setup complete for ${this.id}`);
} catch (e) {
traceWarning(e);
}
Expand Down Expand Up @@ -640,6 +654,7 @@ export class JupyterServerBase implements INotebookServer {
if (this.launchInfo && this.launchInfo.connectionInfo && this.launchInfo.connectionInfo.localProcExitCode) {
// Not running, just exit
const exitCode = this.launchInfo.connectionInfo.localProcExitCode;
traceError(`Jupyter crashed with code ${exitCode}`);
subscriber.error(this.sessionStartTime, new Error(localize.DataScience.jupyterServerCrashed().format(exitCode.toString())));
subscriber.complete(this.sessionStartTime);
} else {
Expand Down Expand Up @@ -716,6 +731,10 @@ export class JupyterServerBase implements INotebookServer {
}
}
} else {
const sessionDate = new Date(this.sessionStartTime!);
const cellDate = new Date(subscriber.startTime);
traceInfo(`Session start time is newer than cell : \r\n${sessionDate.toTimeString()}\r\n${cellDate.toTimeString()}`);

// Otherwise just set to an error
this.handleInterrupted(subscriber.cell);
subscriber.cell.state = CellState.error;
Expand Down
Loading