NVIDIA / NVIDIA/TensorRT-LLM

[Bug]: WatchEventQueue.drain leaves unfinished queue tasks

Open Beginner friendly
#17,762 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Testing
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.