kragniz / kragniz/python-etcd3
Watching breaks Ctrl+c
- 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
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