[Bug]: WatchEventQueue.drain leaves unfinished queue tasks
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.7k
- Forks
- 2.8k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 489
Description
System Info
Platform-independent asyncio queue behavior on current main.
Reproduction
WatchEventQueue.drain() can dequeue multiple events but calls self.events.task_done() only once after the loop. For a drain containing N > 1 events, N-1 unfinished tasks remain registered in the underlying asyncio.Queue.
A caller that later waits on queue.events.join() can therefore block indefinitely even though the queue is empty.
Expected behavior
Every dequeued queue item should have a matching task_done() call.
Actual behavior
A multi-event drain acknowledges only one item.
Proposed fix
Mark each dequeued event done and add a CPU-only regression test that drains multiple events and verifies join() completes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the WatchEventQueue.drain() implementation and inspect nearby queue tests or test entry points. Reproduce a drain of multiple events in a CPU-only test, then verify that asyncio queue join() completes after every dequeued event is acknowledged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100