|
| 1 | +# Support kernel\_info request on the control channel |
| 2 | + |
| 3 | +## Problem |
| 4 | + |
| 5 | +When connecting a new websocket to an existing kernel via the Jupyter server, if the kernel execution is |
| 6 | +busy (e.g. long running cell) or stopped (e.g. on a breakpoint), the messages sent over the websocket get no reply. This is because when |
| 7 | +establishing a new websocket connection, the Jupyter server will send `kernel_info` requests to the kernel |
| 8 | +and will prevent sending any other request until it receives a `kernel_info` reply. Since the `kernel_info` |
| 9 | +request is sent on the shell channel and the kernel execution is stopped, it cannot reply to that request. |
| 10 | + |
| 11 | +## Proposed enhancement |
| 12 | + |
| 13 | +We propose to state in the Jupyter Messaging Protocol that the `kernel_info` request can be sent on both the shell and the control channels. Although both channels supports the `kernel_info` message, clients are encouraged to send it on the control channel as it will always be able to handle it, while the shell channel may be stopped. |
| 14 | + |
| 15 | +### Impact on existing implementations |
| 16 | + |
| 17 | +This JEP impacts kernels since it requires them to support receiving 'kernel\_info\_request' on the control channel in addition to receiving them on the shell channel. |
| 18 | + |
| 19 | +It also has an impact on the Jupyter Server. For example, the reference implementation of Jupyter Server will attempt to send a a `kernel_info` request on both channels and listen for a response from _either_ channel. Any response informs the UI that the kernel is connected. |
| 20 | + |
| 21 | +## Relevant Resources (GitHub repositories, Issues, PRs) |
| 22 | + |
| 23 | +### GitHub repositories |
| 24 | + |
| 25 | +- [Jupyter server](https://github.com/jupyter-server/jupyter_server): the backend to Jupyter web applications |
| 26 | +- [Jupyter client](https://github.com/jupyter/jupyter_client): Jupyter protocol client APIs |
| 27 | +- [JupyterLab](https://github.com/jupyterlab/jupyterlab): JupyterLab computational environment |
| 28 | + |
| 29 | +### GitHub Issues |
| 30 | + |
| 31 | +- New websocket unable to communicate with kernel paused in debugging [#622](https://github.com/jupyter-server/jupyter_server/issues/622) |
| 32 | +- [Debugger] Active sessions cause the kernel to deadlock on page refresh [#10174](https://github.com/jupyterlab/jupyterlab/issues/10174) |
| 33 | + |
| 34 | +### GitHub Pull Requests |
| 35 | + |
| 36 | +Nudge kernel with info request until we receive IOPub messages [#361](https://github.com/jupyter-server/jupyter_server/pull/361) |
| 37 | + |
0 commit comments