Commit eb92b10b authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

kernel: When switching inferiors, terminate the previous one forcefully.

This fixes a bug whereby ";;guix pin" would sometimes hang in the
'close-inferior' call in 'set-proxy-state-inferior'.

* guix-jupyter-kernel.scm (set-proxy-state-inferior):
Send (primitive-exit 0) to PREVIOUS.
parent 9a9f546e
......@@ -91,7 +91,16 @@
was already an inferior associated with STATE, close it."
(let ((previous (proxy-state-inferior state)))
(when previous
;; XXX: 'close-inferior' sometimes isn't enough and it ends up being
;; blocked in waitpid(2) (from 'close-pipe') while the inferior is
;; stuck in read(2). Thus, forcefully terminate PREVIOUS beforehand.
;; This leads to an 'inferior-eval' exception because the inferior
;; doesn't respond, which we catch.
(false-if-exception
(inferior-eval '(primitive-exit 0) previous))
(close-inferior previous))
(set-proxy-state-property state %inferior-property
inferior)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment