tdaff / remote_ikernel

All your Jupyter kernels, on all your machines, in one place.
https://pypi.org/project/remote_ikernel/
BSD 2-Clause "Simplified" License
16 stars 14 forks source link

Jupyter hangs on long-running computation #25

Open tdaff opened 7 years ago

tdaff commented 7 years ago

Original report by Leonid Kostrykin (Bitbucket: theV0ID, GitHub: theV0ID).


I'm using a remote IPython kernel which I added as follows:

#!bash
remote_ikernel manage --add \
--remote-precmd="source activate /path/to/conda/envs/ipython" \
--kernel_cmd="ipython kernel -f {connection_file}" --name "remote_host/Python2" \
--interface=ssh --host="remote_host" --workdir="/some/path"

I run an arbitrary computation which takes a few hours to finish. The progress of the computations are printed in the Notebook, and the print-out updates itself every second. If I remain at the computer and keep interacting with the Jupyter notebook (mostly scrolling to see the progress) the computation finishes as expected. Contrary, If I just leave the Jupyter notebook open as-is and go away for a few hours (the browser and the notebook remain open of course) the computation always hangs. From the last print-out I see that it usually hangs after about ~300 to ~3000 seconds. I have automatic suspend/hibernate turned off on my computer. This issue doesn't occur if a local kernel is used instead.

Might that be related to a timeout of the SSH tunnels?

tdaff commented 7 years ago

Original comment by Tom Daff (Bitbucket: tdaff, GitHub: tdaff).


I've tried to replicate this but haven't managed so far. I ran a process overnight on an ssh kernel with the browser not in the foreground, but it was still writing output in the notebook in the morning. The tunnel should be happily restarting, as it did for me, but it seems as though that could be where the problem is for you.

If you encounter this issue again there are few things to check: