Mentions légales du service

Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,16 @@ ...@@ -91,7 +91,16 @@
was already an inferior associated with STATE, close it." was already an inferior associated with STATE, close it."
(let ((previous (proxy-state-inferior state))) (let ((previous (proxy-state-inferior state)))
(when previous (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)) (close-inferior previous))
(set-proxy-state-property state %inferior-property (set-proxy-state-property state %inferior-property
inferior))) inferior)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment