kragniz / kragniz/python-etcd3

Watching breaks Ctrl+c

Open
#47 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
450
Forks
194
PR merge metrics
No merged PRs in 30d

Description

To reproduce, run make a `watcher.py`:

```python
import etcd3

etcd = etcd3.client()

etcd.put('/doot/watch', 'dfdd')

for event, cancel in etcd.watch_prefix('/doot/watch'):
print(event)
```

I'd expect Ctrl+c to exit the process, but that doesn't work:

```
(py27) ~/g/python-etcd3 (feature-watch) $ python watcher.py
header {
cluster_id: 14841639068965178418
member_id: 10276657743932975437
revision: 5057
raft_term: 4
}
created: true

^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
```

Sending a SIGTERM makes it exit.

Contributor guide

Open the contributing guide

Research direction

Start by running the watcher.py reproduction and trace the etcd.watch_prefix entry point used by the loop. Verify how Ctrl+C is handled while the watch is blocking; done means the process exits on SIGINT as expected, while preserving normal watch behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.