-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
<debug_request> publish the <status:idle> while an <execute_request> is running #799
Comments
Until the debugger, all requests on both control and shell were handled in the say way - where one request could be processed at a time, and thus the kernel was always 'busy' or 'idle', regardless of which queue the task came from. Control being a separate queue does not mean that control requests don't block in the same way that shell requests do, nor that they are concurrent. Just that they jump to the head of the line when the kernel is ready to handle the next request, whichever queue it may come from. However, debug state being concurrent does complicate things. I'm not quite sure what the right answer is there. |
In previous versions like 5.5.6, it's true and all requests are put into <msg_queue> by <schedule_dispatch> and processed in order by <dispatch_queue> -> <process_one> |
In short, previous versions use one poller to get msg from msg_queue, while the latest version uses two pollers to get msg from two queues, and this causes two dispatchers to process and publish the status concurrently |
I see two options to fix this issue (but there are probably others):
I find the last solution more flexible (it allows to add more costly request on the control channel in the future), and that would be a backward compatible change in the protocol. |
In ipykernel 5.5.6,both <control_stream> and <shell_stream> put msgs into <msg_queue> and process the msg with <schedule_dispatch>. Although both <dispatch_control> and <dispatch_shell> publish the <status: busy/idle>,there are no conflicts.
When it comes to ipykernel 6.5.0, <control_stream> put msgs into <control_queue> and process the msg with <dispatch_control>, while shell_stream still works in the old way. This means <process_control> and <dispatch_shell> will publish the <status: busy/idle> in the same time.
I found this problem in jupyterlab when i executed a cell(sleep 600s) in an ipykernel with <metadata: {debugger: True}>,i switched to another ipynb and switched back. The cell was still running, but the kernel execution_state became idle. Then i found the ipykernel received multi <debug_requests> and published the status to idle.
As https://jupyter-client.readthedocs.io/en/latest/messaging.html said "Debug requests and replies are sent over the control channel to prevent queuing behind execution requests". It confuses me that why control_requests affect the kernel's execution_state? Should we use another state like control_state?
The text was updated successfully, but these errors were encountered: