-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Successfully executed cells get stuck in busy state until notebook finishes its run #4334
Comments
Is it possible to receive some guidance at how to debug this problem? I surely understand you can't fix it if you can't reproduce it, but perhaps you have some insights at where to look for the cause. This problem makes the notebook environment very problematic to use as it screws up all the navigation in the notebook. Thank you. |
I gave it another go and went even further back in time until I found a working scenario and then proceeded forward until I hit the problem, and here is what I found: Last working (no busy cells): python-3.5.6
First not working (busy cells): python-3.6.0
I compared identical setups, hence the restrictions on version numbers, since py35 has no conda packages for latest versions. The resulting environments have slightly varying packages as not all dependencies had the same versions built for both python versions. I also tried to build the whole env with pip instead of conda with the same results. So, if I did everything correctly it indicates that some change in python-3.6.0 introduced this problem. There is a huge list of changes, I won't know what to look for. Do note that I first tested with python27 and had no problems there either. So I'm happy I found that some earlier python versions did work just fine and that the problem doesn't have anything to do with extensions, custom config or browser versions. Unfortunately, I need at least python-3.6 to work. So the working 3.5.6 setup isn't helpful :( Any suggestions on how to proceed? |
Oh great, I found I can share a notebook online and you can run it and see the problem for yourself! Please run: Luckily the problem appears there too. So now you can clearly see that it's a bug in the notebook project and it's unrelated to the user's setup. I updated the first post to include the link to the live notebook. |
I further debugged this by instrumenting
and basically what happens is that Most likely the flow needs to be changed to await FWIW, "iopub" channel receives
and it's configured to run upon |
Same problem here. Only occurs after upgrading to python3 (no such problem in python 2).
It seems to happen when I use pandas to read large csv files. |
Thanks @stas00, I am able to reproduce the same behavior, it almost always stuck in the same cell, although 1 out of 20~30 trial it behave normally. |
Any fix found yet? I'm encountering the same issue. |
@stas00 found the issue appears after python 3.6 is quite interesting, I would expect the issue is coming from update of jupyter. I have done some more testing on a Window 10 Machine and find that the issue is only exist in python 3.6.
# py35
conda create -n py35
conda install python==3.5.5 jupyter
# py36
conda create -n py36
conda install python==3.6.0 jupyter
# py37
conda create -n py37
conda install python==3.7.0 jupyter
|
Unfortunately after I mistakenly install a different version of python in my base (was python3.7.0), I start to get the same bug........ but I am pretty sure I had a python 3.7.0 running smoothly before. At first I was thinking this maybe a Window vs Linux issue, but now I couldn't reproduce an working environment in 3.7.0 |
@stas00 Ok, so I have made some progress, this confirm my initial finding that python>3.6.0 can works too. Here is what I have done to create an working environment with python 3.6.0. Here is my exact steps to create such an environment
I am guessing step 3 is not that related, as I do step 1-3 and still getting the same bug, only after I do step 4 I get a working environment. I then do
|
yay, thank you for digging more into it, @noklam . Following your steps I did some more bisecting and now found the real culprit. It's ipykernel=5.0.0 that breaks it. Can you please double check? this works:
this breaks:
Difference between envs:
I also updated my normal environment to force downgrade to ipykernel=4.10.0 and it no longer gets stuck - yay! But, of course, ipykernel still needs to be fixed. |
further bisected into ipykernel and found the commit that broke it: ipython/ipykernel@3b1f632
Opened an Issue ipython/ipykernel#389 Thank you all who helped to find the culprit and your support! |
@stas00 I can confirm when I switch from ipykernel==4.10.0 -> 5.0.0 the bug starts to appear. Except that I don't have a nice conda-tools like you and I don't know a good way to show diff file in Window (Normally I just check them in VS code, I cannot find a way to output the diff). So I turn into a web diff tools instead: |
I am having a similar issue, and keep having the problem with different versions of python 3.6, 3.7 and ipykernel. I don't think just downgrading to ipykernel=4.10.0 solves the issue. The behavior is bizarre: The jupyter notebook does all the calculations and displays them very fast, but the kernel shows busy, even after doing all the calculations and displaying them correctly. Then, if I do a new cell, or update a value in a previously calculated cell and recalc, the * (kernel busy) stays there until:
If I do "stop" and recalc, the calculation is fast and displayed promptly as usual, but the kernel remains "busy" for a while. So it looks to me that there is a buffer of "junk" somewhere that is not allowing calculations on new cells until the "junk" is processed. The video below (zippped and youtube link) better illustrates the issue. I have not tried a python-3.5.6 with ipkernel 4.10.0 as @noklam and @stas00 suggested. demo_error.mp4.zip update |
I have been experiencing a strange problem. With Run All the cells run and clear the busy status just fine and then at some cell down the road successfully executed cells start showing as busy
[*]
. It seems to appear in random places in different notebooks, usually in the exact same code cell of a given notebook, regardless of the content. Here is a snapshot from 'Run All':I succeeded at creating a simple test case (had to rename it to .txt to be able to upload, please rename it to .ipynb to try).
stuck.txt
You can reproduce this problem by running it live in one click here:
https://mybinder.org/v2/gh/stas00/fastai-misc/master?filepath=debug%2Fjupyter%2Fstuck.ipynb
If I save the notebook while it's in this state,
execution_count
for those cells appears asnull
. If I let the notebook finish and then save them, theexecution_count
becomes set to non-null
.The same problem happens in chrome and firefox. I tried different python versions, downgrading all the different jupyter components, disabling extensions, config and what not, it is still there.
Here is the debug output run at which the snapshot was taken.
Perhaps it has something to do with this switch to busy state as can be seen from the debug log? The initial cells clear out fast enough, so it doesn't switch to busy. Yet, once a slow code cell is encountered it looks like it stops updating the status of the cells, even the ones above it, that it didn't have a chance to clear yet. It remains like this for the rest of the notebook, regardless of its length.
Any other things I can try to find out the culprit?
I asked a friend and he said he also has encountered this issue.
Versions:
Ubuntu-18.04
notebook server is: 5.7.4
Python 3.7.1
IPython 7.2.0
The text was updated successfully, but these errors were encountered: