Skip to content

Commit

Permalink
Do not dispose message handler when cell completes
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Oct 5, 2022
1 parent 535a390 commit b978200
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 22 deletions.
13 changes: 0 additions & 13 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2315,7 +2315,6 @@
"@vscode/test-electron": "^2.1.5",
"@vscode/test-web": "^0.0.29",
"acorn": "^6.4.1",
"await-lock": "^2.2.2",
"babel-polyfill": "^6.26.0",
"bufferutil": "^4.0.6",
"chai": "^4.3.0",
Expand Down
1 change: 0 additions & 1 deletion src/kernels/execution/cellExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ export class CellExecution implements IDisposable {
public dispose() {
traceCellMessage(this.cell, 'Execution disposed');
disposeAllDisposables(this.disposables);
this.cellExecutionHandler?.dispose();
}
private completedWithErrors(error: Partial<Error>) {
traceWarning(`Cell completed with errors`, error);
Expand Down
8 changes: 1 addition & 7 deletions src/notebooks/controllers/vscodeNotebookController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ import { initializeInteractiveOrNotebookTelemetryBasedOnUserAction } from '../..
import { NotebookCellLanguageService } from '../languages/cellLanguageService';
import { IDataScienceErrorHandler } from '../../kernels/errors/types';
import { IJupyterServerUriStorage } from '../../kernels/jupyter/types';
import AwaitLock from 'await-lock';

/**
* Our implementation of the VSCode Notebook Controller. Called by VS code to execute cells in a notebook. Also displayed
Expand All @@ -109,7 +108,6 @@ export class VSCodeNotebookController implements Disposable, IVSCodeNotebookCont
private readonly disposables: IDisposable[] = [];
private notebookKernels = new WeakMap<NotebookDocument, IKernel>();
public readonly controller: NotebookController;
private lock = new AwaitLock();
/**
* Used purely for testing purposes.
*/
Expand Down Expand Up @@ -297,11 +295,7 @@ export class VSCodeNotebookController implements Disposable, IVSCodeNotebookCont
}
await initializeInteractiveOrNotebookTelemetryBasedOnUserAction(notebook.uri, this.connection);
// Notebook is trusted. Continue to execute cells
await Promise.all(cells.map(async (cell) => {
await this.lock.acquireAsync();
await this.executeCell(notebook, cell);
this.lock.release();
}));
await Promise.all(cells.map((cell) => this.executeCell(notebook, cell)));
}
private warnWhenUsingOutdatedPython() {
const pyVersion = this.kernelConnection.interpreter?.version;
Expand Down

0 comments on commit b978200

Please sign in to comment.