Skip to content
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

Notebook not reconnecting to cell output in progress on refresh #213

Open
c0d3rman opened this issue Feb 1, 2023 · 2 comments
Open

Notebook not reconnecting to cell output in progress on refresh #213

c0d3rman opened this issue Feb 1, 2023 · 2 comments

Comments

@c0d3rman
Copy link

c0d3rman commented Feb 1, 2023

I've been trying to figure out the right place to post this issue, apologies if this is not it.
A common problem with Jupyter notebooks is that if you have a long-running cell producing continuous output and you disconnect from the kernel temporarily (e.g. due to a refresh or putting your computer to sleep), the cell stops showing output. The code is still running, and output is still arriving (you can see the messages in the websocket in the browser developer tools), but the cell itself shows only the partial output from before the disconnect and the brackets next to the cell are empty as if it had not been run at all.
Given that the output is making it to the browser, I assume this is some sort of issue with updating the output area. I've poked around a little and can't quite understand the architecture yet, but I figured y'all know it best and might know how to fix this.
An example notebook cell for replicating this:

import time
i = 0
while True:
    time.sleep(1)
    i += 1
    print(i)

Run the cell, let it run for a bit, then refresh. Output stops showing, but you can see in dev tools that the messages are still coming through.
Thanks for your help.

@echarles
Copy link
Member

echarles commented Feb 1, 2023

Thx for opening this @c0d3rman. This is a very interesting requirement I have been playing with yesterday as having to deeal with a long running cell execution - e.g. JupyterLab does not handle the reconnection to cell outputs, while solutions like Google Collab take that into account. I have not searched the various Jupyter repos for prior discussion so I can not say for now if that question has ever been tackled.

I will add a topic at today notebook community meeting.

cc/ @RRosio @ericsnekbytes @blink1073 @Zsailer @kevin-bates @seibert

@kevin-bates
Copy link
Member

This is a long-standing issue and one that will hopefully be resolved by the real-time collaboration (RTC) efforts. There have been numerous issues opened for this, in multiple repositories, but the one issue often referenced (and appears to still be somewhat active in that it contains RTC-related comments) is jupyter/notebook#641.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants