Skip to content
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

Add waitUntil for onDidStart event #16375

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

pwang347
Copy link
Member

@pwang347 pwang347 commented Jan 13, 2025

For more context, see #16387


show() {
let execution: IReference<NotebookExecution> | undefined;
try {
Copy link
Member Author

Choose a reason for hiding this comment

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

@DonJayamanne I wrapped this in a try-catch and added the justification below - do you see any problems with this?

Copy link
Member Author

@pwang347 pwang347 Jan 15, 2025

Choose a reason for hiding this comment

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

would it be better to pass in a flag to show to skip the execution check? also, let me know if you'd prefer that I keep this class in the original file (I figured moving it out might be cleaner now that the other file has a dependency on it as well)

Copy link
Contributor

Choose a reason for hiding this comment

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

What is the exact failure. This line exists to show a progress indicator against the kernel...
& thats actually a good thing, else there's no way to display progress indicators other than relying on the progress message.

Copy link
Member Author

Choose a reason for hiding this comment

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

Here is the trace I get:

Error: duplicate cell execution for vscode-notebook-cell:/Users/paulwang/Downloads/demo.ipynb#W0sZmlsZQ%3D%3D
    at ey._createNotebookExecution (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:153:26392)
    at Object.createNotebookExecution (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:153:21721)
    at NotebookExecutionReferenceCollection.createReferencedObject (/Users/paulwang/Desktop/tmp/vscode-jupyter/src/standalone/api/kernels/kernelProgressIndicator.ts:38:55)
    at NotebookExecutionReferenceCollection.acquire (/Users/paulwang/Desktop/tmp/vscode-jupyter/src/platform/common/utils/lifecycle.ts:321:52)
    at _KernelExecutionProgressIndicator.show (/Users/paulwang/Desktop/tmp/vscode-jupyter/src/standalone/api/kernels/kernelProgressIndicator.ts:90:68)
    at waitUntil (/Users/paulwang/Desktop/tmp/vscode-jupyter/src/standalone/api/kernels/index.ts:111:61)
    at Ph.value (/Users/paulwang/.vscode-insiders/extensions/vscode-test-person.helloworld-sample-0.0.1/src/extension.ts:33:5)
    at P.B (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:27:2373)
    at P.fire (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:27:2591)
    at /Users/paulwang/Desktop/tmp/vscode-jupyter/src/standalone/api/kernels/index.ts:100:50
    at AsyncEmitter.fireAsync (/Users/paulwang/Desktop/tmp/vscode-jupyter/src/platform/common/utils/events.ts:104:17)
    at KernelProvider.<anonymous> (/Users/paulwang/Desktop/tmp/vscode-jupyter/src/kernels/kernelProvider.node.ts:101:64)
    at AsyncEmitter.fireAsync (/Users/paulwang/Desktop/tmp/vscode-jupyter/src/platform/common/utils/events.ts:104:17)
    at /Users/paulwang/Desktop/tmp/vscode-jupyter/src/kernels/kernel.ts:272:46
    at Function.wrapKernelMethodImpl (/Users/paulwang/Desktop/tmp/vscode-jupyter/src/notebooks/controllers/kernelConnector.ts:481:21) (at console.<anonymous> (file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:156:26594))

If I understood correctly, we probably don't want to create an execution reference when the waitUntil is called since it's possible that no kernel execution actually happens there, but we can let that happen when execute is called (we're just borrowing the messaging logic here).

@pwang347 pwang347 changed the title [DRAFT] Add waitUntil for onDidStart event Add waitUntil for onDidStart event Jan 15, 2025
@pwang347 pwang347 marked this pull request as ready for review January 15, 2025 22:54
Copy link
Contributor

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

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

Just a few minor changes, else all looks good.

src/kernels/kernel.ts Outdated Show resolved Hide resolved
src/kernels/kernel.ts Outdated Show resolved Hide resolved
src/kernels/kernel.ts Outdated Show resolved Hide resolved
src/kernels/kernelExecution.ts Outdated Show resolved Hide resolved
src/kernels/types.ts Outdated Show resolved Hide resolved
src/standalone/api/kernels/api.vscode.common.test.ts Outdated Show resolved Hide resolved
src/standalone/api/kernels/api.vscode.common.test.ts Outdated Show resolved Hide resolved
src/standalone/api/kernels/index.ts Show resolved Hide resolved

show() {
let execution: IReference<NotebookExecution> | undefined;
try {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the exact failure. This line exists to show a progress indicator against the kernel...
& thats actually a good thing, else there's no way to display progress indicators other than relying on the progress message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants