driplineorg / driplineorg/dripline-python

Signal handling doesn't work in interactive Python session

Open
#167 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
3
Forks
6
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at core.Interface and compare its signal_handler and cancelable setup with the dl-serve executable path. Reproduce the broker retry scenario in an interactive Python session and verify that Ctrl-C cancels cleanly without an unhandled exception or long traceback; the issue names no file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.