-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Better handling of slow kernel startup #8174
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
I am moving to the next milestone so we have some more discussion on this before merging, but seems reasonable! |
I tried the resolve merge feature in Github. It results in a merge commit. I'll rebase and push. |
Allow switching kernels while a session is initializing Account for kernel switching wip testing session context Finish up logic and tests Cleanup Fix handling of No Kernel in switcher dialog Fix handling of no kernel selected Address review comments
332519f
to
179f8d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@meeseeksdev please backport to 2.1.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
References
#7403 #6007
See discussion in jupyter-server/jupyter_server#197 about the issues around slow starting kernels/terminals and a longer term solution.
While a slow kernel is starting, show it as being in "initializing" status with a filled circle and the name of the pending kernel. The user is now allowed to change the kernel while the previous session is starting. When a session is started, it shuts down an existing session so there is only one running session on the server.
We have to destroy an in-flight session connection rather than wait for it to finish. We properly shut down sessions that have been superseded. The classic notebook handles session restarts by destoying/creating, but does so synchronously. The user has to wait for the slow session to start before it switches. Classic notebook does not handle a change kernel request while the initial kernel is being created.
We use a unique id for the path when creating the session, and then change the path of the created session to the desired path. This is to avoid the race condition of when a session with a given path saves its state in the server database.
Note, I simulated slow kernels by adding a
gen.sleep()
instart_kernel
.I plan to backport this to 1.2.x since it involves no API changes and is a bug fix.
Slow start:
Switching during a slow start:
Selecting no kernel during a slow start:
Code changes
Add internal logic to session context to handle slow kernel behavior. Show filled icon for initializing status and in the toolbar. Update status bar handlers to always use display name and display status from the session context.
User-facing changes
Better indication of the status of slow starting kernels.
Backwards-incompatible changes
None