ipython / ipython/ipykernel

How can I detect from labextension whether kernel is still alive?

Ouverte
#428 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
734
Forks
412
Merge moyen
1 j 5 h
PR mergées (30 j)
8

Description

I use ipykernel 5.1.2 on a remote machine via ssh with local comm ports (created by jupyter lab 1.1.1) mapped to remote comm ports (created via `jupyter_client.write_connection_file`) via ssh port forwarding.

Everything works perfectly fine.
Now, my remote machine can be stopped externally (auto termination of remote platform).
I don't find a reasonable way to detect from javascript (in my labextension) whether the python kernel is really alive.
None of the status or alive methods detect a vanished kernel. The last idea I had was to use something like

```
f = s.kernel.requestExecute({code:"pass", silent:true})
f.onReply = handler
```
to force python execution (when returning immediatley/soon, I am sure the kernel runs)

However, sound like pretty heavy.

Is there an easier way that reliably detects kernel death?

Thanks,
Bernhard

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.