jupyter
jupyter copied to clipboard
Remote kernel cannot start
A fancy way of starting a remote kernel is though https://github.com/emacs-jupyter/jupyter?tab=readme-ov-file#starting-a-remote-kernel, but it get emacs stuck in the latest release 30.1. I found the minimum code to reproduce it is like
(let ((file "/ssh:aaa:/home/bbb/foo1.txt"))
(with-timeout (2.5 (delete-file file))
(while (file-exists-p file)
(accept-process-output nil 0.25))))
which correspond to https://github.com/emacs-jupyter/jupyter/blob/db8a9e233a010a61063f34220821ec76157a2d84/jupyter-env.el#L182 of function jupyer-session-with-random-ports. It always stuck in 30.1 while works fine in 29.4, the reason is unclear to me. But since for remote file, (interrupt-process process) at above line only interrupt local process and don't remove remote file, so maybe we can change function call around to something like below to solve it?
(jupyter-with-timeout
(nil (if (file-remote-p conn-file) 0 jupyter-default-timeout)
(delete-file conn-file))
(not (file-exists-p conn-file)))
Also, org src block to reproduce this issue
#+begin_src jupyter-python :session /ssh:aaa:test
print(123)
#+end_src