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

Remove starting of a session and disposing it when connecting to remote Jupyter servers #8185

Closed
DonJayamanne opened this issue Nov 5, 2021 · 3 comments
Assignees
Labels
debt Code quality issues notebook-remote Applies to remote Jupyter Servers

Comments

@DonJayamanne
Copy link
Contributor

When connecting to remote jupyter servers we create sessions:

        // Try creating a session just to ensure we're connected. Callers of this function check to make sure jupyter
        // is running and connectable.
        const session = (await this.sessionManager.startNew(
            undefined,
            defaultKernel,
            launchInfo.connectionInfo.rootDirectory,
            cancelToken,
            launchInfo.disableUI
        )) as JupyterSession;
        const idleTimeout = this.configService.getSettings().jupyterLaunchTimeout;
        // The wait for idle should throw if we can't connect.
        await session.waitForIdle(idleTimeout);
        await session.dispose();

If we want to check if the jupyter server is running & connectable, why not use an API such as getting a list of the kernels.
This feels unnecessary.

E.g. if we cannot start the default kernel then we cannot connect at all (& we have a few issues where users connecting to remote servers cannot start the default kernel). I too ran into this a few months ago, admittedly its because my default python kernel was busted.

I think we can just remove this & test connectivity by simply calling the API to get a list of kernels/sessions or similar API.

@miguelsolorio
Copy link

Ran into this bug today and Don was able to isolate the issue for me and unblock me. In this case there were no notifications or any indication that something was broken. After re-installing conda I was able to see the Failed to start the kernel error.

@DonJayamanne
Copy link
Contributor Author

Done.

@DonJayamanne
Copy link
Contributor Author

Testing

  • Use non-raw kernels
  • Ensure your default global python kernel is busted (perhaps modify the kernelspec.json file to change the argv)
    • Open jupyter, create a blank notebook & select the default kernel & ensure it doesn't work (jupyter will time out trying to use it)
  • Start jupyter server locally and point to that.
  • Connect to it from VS Code, and you should be able to pick a kernel and run stuff (even though the default is busted)
  • In the past we woudl'nt even connect to the remote server (kernels would not be listed in the kernel picker)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues notebook-remote Applies to remote Jupyter Servers
Projects
None yet
Development

No branches or pull requests

3 participants