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
Can't reconnect to running Python2 notebook #7647
Comments
I think we made it wait for the kernel to be idle before it decided that the kernel had started. Which is problematic in the case you describe. |
@takluyver does the kernel run in a separate process (or real thread) than the web server? If so, I'd think we could make it so the web server knew that the kernel exists and is busy- then it could relay that to the front-end which should fix this problem. |
@jdfreder you haven't completely forgotten our architecture, have you? Yes, kernels are separate processes from the web server. As I remember, we made a deliberate decision that the frontend should wait for the kernel to be connected and idle before showing that it had started, so we could be sure it was ready to receive messages. In most cases, that makes sense, but it doesn't if you have a long-running function and you reconnect to a notebook. @minrk probably recalls this stuff better than I do. |
Maybe @minrk can shed some light on why keeping track of the kernel's state in the web server is a bad idea. It seems like it would be an 'easy' solution... |
The server never disconnect from the kernel and act only as a zmq-websocket bridge at this stage. The other thing that it won't help with is that disconnection browser and reopen won't forward output. |
I think there are two separate ways in which we wait for kernel_info:
I think the problem is caused here by the fact that we set the 'starting...' notification after finishing the websocket connection, which we did before the websocket connection waited for the kernel_info reply before opening. I think a small, but careful readjustments of kernel events and notifications should fix this one. |
I installed the current git-master version of IPython, started a notebook server on a remote machine and then I made a notebook running a long calculation. It periodically outputs results (with clear_output(wait=True) and print()). So I left it running, saved it, and closed the browser. But when I returned to it, it didn't work. It says "Kernel starting" and it stays like that forever. The icon shows that the notebook is busy, the CPU usage is 100% as expected, but I can't see any output. Reconnect Kernel doesn't help.
The text was updated successfully, but these errors were encountered: