driplineorg / driplineorg/dripline-python

Signal handling doesn't work in interactive Python session

オープン
#167 コメント 3 件 リアクション 0 件 担当者 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
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。