How to signal shutdown by user code?
还没有人认领这个 Issue。
评估
调研方向
从 ipykernel.kernelbase.Kernel 和 issue 中描述的 do_execute 入口点开始。跟踪当前如何处理执行异常和 kernel 关闭,然后检查现有的 kernel 生命周期测试或文档。完成的标准是:确定并记录一种受支持的方式来处理变得不可用的解释器,或者确认不支持任何 kernel 内关闭路径。
由索引模型根据 Issue 内容生成。
描述
I'm implementing a kernel by inheriting from ipykernel.kernelbase.Kernel, as described at Making simple Python wrapper kernels.
My do_execute method passes code to an external interpreter implemented in a Python module, and it is possible that this code includes an instruction to shut down the interpreter, comparable to sys.exit(0) in Python. When that happens, the interpreter raises an exception.
Because after that code the interpreter is no longer usable, I want to catch that exception and in response initiate a kernel shutdown. Unfortunately, I wasn't able to figure out how to do so.
Is it possible to initiate a kernel shutdown from within the kernel? If yes, how?
If not, what is the recommended way to deal with code which shuts down the interpreter? Detecting that from the code might be impossible to do correctly. And even if I could do it, I would still have to initiate shutdown from within do_execute.
- 主要语言
- Python
- 星标
- 734
- 派生
- 411
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 9
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ipython/ipykernel 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 1/5 1 小时以内 新手友好度 72/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 68/100
查看 ipython/ipykernel 的全部 Issue
相似的 Issue
-
bug confirmed issue
难度 2/5 1-3 小时 新手友好度 75/100
open-webui/open-webui#30750 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
good first issue
难度 1/5 1 小时以内 新手友好度 90/100