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

Support interrupting non-python kernels #8108

Closed
wants to merge 2 commits into from
Closed

Conversation

DonJayamanne
Copy link
Contributor

For #8107

Basically non-python kernles are not interrupted today as we don't send the sigint signal.

@DonJayamanne DonJayamanne requested a review from a team as a code owner October 29, 2021 21:44
@@ -92,6 +92,8 @@ export class JupyterSettings implements IWatchableJupyterSettings {
public interactiveWindowMode: InteractiveWindowMode = 'multiple';
// Hidden settings not surfaced in package.json
public disableZMQSupport: boolean = false;
// Hidden settings not surfaced in package.json
public disablePythonDaemon: boolean = false;
Copy link
Contributor Author

@DonJayamanne DonJayamanne Oct 29, 2021

Choose a reason for hiding this comment

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

Added this for testing purposes

return true;
}
if (this._kernelConnectionMetadata.kernelSpec.interrupt_mode === 'message') {
return false;
Copy link
Contributor Author

@DonJayamanne DonJayamanne Oct 29, 2021

Choose a reason for hiding this comment

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

the raw kernel process can only interrupt pyton daemon kernels or kernsls that support signal interrupts (not interrupts via messages)

// session: this.realKernel.clientId,
// content: {}
// }) as any) as KernelMessage.IShellMessage<'inspect_request'>;
// await this.realKernel.sendShellMessage<'inspect_request'>(msg, true, true).done;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code seems to be right, however I can't find any kernel that implements this even though the protocol supports this.
Hence not sure whether we should enable this or not.

Worse case nothing happens
Commented this out so we can discuss this.
Personally feel its ok to enable this, if there are kernels that support message interrupts (for windows or even unix)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah seems okay to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok to enable or keep it commented out.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok to enable. It doesn't hurt anything AFAICT

Copy link
Member

Choose a reason for hiding this comment

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

Code looks like it's for 'inspect_request'? Isn't that for variables?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry,that part was for generics to work. Jupyter Lab NPM package doesn't support the interrupt_message request in their TS Types.
I changed it and used any.
The actual payload however is for interrupt request.

* Fix up changelog

* Update 3rd party distribution

* Update engine version

* Update change logs

Co-authored-by: Don Jayamanne <don.jayamanne@outlook.com>

Co-authored-by: Don Jayamanne <don.jayamanne@outlook.com>
@DonJayamanne
Copy link
Contributor Author

Closing this PR in favor of https://github.com/microsoft/vscode-jupyter/compare/interruptNonPythonKernels?expand=1
No chages, for some reason this PR would show thirdparty notices file had changes (even after rebasing with main).

@DonJayamanne DonJayamanne deleted the interruptKernels branch September 2, 2022 06:26
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.

3 participants