-
Notifications
You must be signed in to change notification settings - Fork 949
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
Use control comm target in base Manager #3335
Use control comm target in base Manager #3335
Conversation
314e371
to
d95b219
Compare
|
992cdaf
to
82bc9fe
Compare
82bc9fe
to
a2ec50e
Compare
|
meeseeksdev backport to 7.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. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
Comment: could this be part of the base manager? |
We could probably do this to check for the target: const reply = await kernel.requestCommInfo({target_name: this.comm_target_name}); The documentation is not entirely clear on the behavior of this when the target is no registered (to be improved): https://jupyter-client.readthedocs.io/en/stable/messaging.html#comm-info |
Question: what happens if I reduce the tornado web socket message size limit to something very small? Does it fail? How? |
My guess is that the message will just never come back from the kernel. I think it would be good to have a timeout on the request that will fall back to the older method. Separately, I think it would be good to have a check in the server zmq/websocket bridge to see if a comm message is too big, and if it is, send a comm_close message both ways (to kernel and frontend) with an error status, indicating the comm channel had an error. |
e4de26b
to
8874d65
Compare
Unfortunately this doesn't work. The kernel answers to the request with |
8874d65
to
3cc6adb
Compare
I updated the PR this morning:
Unfortunately we can't use the commInfo request to know if the target is registered kernel-side. See #3335 (comment) |
Check again: what are the exact response messages when
|
Also adding a link to the |
The xeus implementation looks similar https://github.com/jupyter-xeus/xeus/blob/eab12033ed8dc0202dfba733446dcf7ced10fca1/src/xkernel_core.cpp#L303-L322 (reply status is always "ok" and the comm object is either empty or contains comms) |
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.
Looks good! Two minor comments to address inline, and then +1 from me to merge. Thanks!
3cc6adb
to
6ed1623
Compare
6ed1623
to
ba01c58
Compare
Thanks for your review @jasongrout |
This error message was introduced in jupyter-widgets#3335. It shows up when the user refreshes the JupyterLab page on a kernel that has not yet imported ipywidgets, because the manager requests for widgets states, but the kernel is not able to answer back any widget model as ipwidgets was not imported. It is a normal workflow that should not show any error message. This error message would also show up when using the manager with a kernel using ipywidgets 7, in that case as well we should not show any error message as it's a normal workflow too. This PR removes the error message to prevent any confusion from the user.
This error message was introduced in #3335. It shows up when the user refreshes the JupyterLab page on a kernel that has not yet imported ipywidgets, because the manager requests for widgets states, but the kernel is not able to answer back any widget model as ipwidgets was not imported. It is a normal workflow that should not show any error message. This error message would also show up when using the manager with a kernel using ipywidgets 7, in that case as well we should not show any error message as it's a normal workflow too. This PR removes the error message to prevent any confusion from the user.
Port of voila-dashboards/voila#766 for JupyterLab and classic Jupyter Notebook
Use the
jupyter.widget.control
comm target for fetching widget states in the JupyterLab manager and the widgetsnbextension, this is used e.g. when refreshing the JupyterLab page on an already running kernel that contains widgets.It will also be used by Voila in voila-dashboards/voila#846.
I would really like this to be considered for the coming 8.0.0 release. It would also be nice to backport it to the 7.x branch if we keep making releases from there.
User facing changes
This improves the performances when refreshing the JupyterLab page or when connecting to an already existing kernel that contains widgets.