ipython / ipython/ipykernel

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

未關閉
#428 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
734
分支
412
平均合併
1 天 5 小時
30 天內合併 PR
8

描述

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

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。