mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-06 07:51:39 -05:00
jupyter-kernel-process: Handle fatal signals of a kernel process more cleanly
In the process sentinel, only consider the process dying as unexpected when the process object still has a :kernel property.
This commit is contained in:
parent
97dcb49e46
commit
37c3187f8f
1 changed files with 6 additions and 5 deletions
|
@ -362,17 +362,18 @@ See also https://jupyter-client.readthedocs.io/en/stable/kernels.html#kernel-spe
|
|||
(lambda (process _)
|
||||
(pcase (process-status process)
|
||||
('signal
|
||||
;; If a kernel dies unexpectedly, run the shutdown
|
||||
;; procedure on it.
|
||||
(jupyter-shutdown (process-get process :kernel))))))))
|
||||
(let ((kernel (process-get process :kernel)))
|
||||
(when kernel
|
||||
(warn "Kernel died unexpectedly")
|
||||
(jupyter-shutdown kernel)))))))))
|
||||
(cl-call-next-method))
|
||||
|
||||
(cl-defmethod jupyter-shutdown ((kernel jupyter-kernel-process))
|
||||
"Shutdown KERNEL by killing its process unconditionally."
|
||||
(let ((process (jupyter-process kernel)))
|
||||
(when process
|
||||
(delete-process process)
|
||||
(setf (process-get process :kernel) nil))
|
||||
(setf (process-get process :kernel) nil)
|
||||
(delete-process process))
|
||||
(cl-call-next-method)))
|
||||
|
||||
;; TODO
|
||||
|
|
Loading…
Add table
Reference in a new issue