driplineorg / driplineorg/dripline-python

Signal handling doesn't work in interactive Python session

未关闭
#167 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Python
星标
3
派生
6
PR 合并指标
30 天内没有已合并 PR

描述

Currently, to use the scarab-based signal handling you have to create a signal_handler and add the appropriate cancelable. This is fine for executables, e.g. dl-serve. However, it's not workable for an interactive session.

I created a script that uses `core.Interface` to e.g. `get peaches` from the KVS. For network reasons it wasn't able to contact the broker, so it tried multiple times using exponential backoff. I attempted to cancel that with ctrl-c, but it didn't work because the signal hadn't been setup to be caught. I got it to stop by repeating ctrl-c twice, resulting in an unhandled exception and a long traceback.

I'm not sure what the right way to handle this is, at the moment.

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 core.Interface 开始,将其 signal_handler 和 cancelable setup 与 dl-serve 的可执行文件路径进行比较。在交互式 Python 会话中复现 broker retry 场景,并验证 Ctrl-C 能够干净地取消,不会出现未处理的异常或很长的 traceback;该 issue 未指明文件或测试。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
cli
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。