[https://nvbugs/6566772][fix] Predicate idle on not self.is_shutdown so a non-blocking timedelta(0) is… - #17426
Open
trtllm-agent wants to merge 1 commit into
Open
Conversation
PyExecutor._fetch_and_enqueue_requests chose an unbounded request_queue.get() whenever an iteration was idle, including after the shutdown sentinel had already been consumed. Once that sentinel is drained, enqueue_shutdown_request() has cleared the queue's active flag, so no further item can ever arrive to wake the get(). The executor loop therefore never reached the should_stop_processing check that ends it, and PyExecutor.shutdown() blocked forever on shutdown_event, which in turn hung the proxy's f.result() on the worker MPI future during LLM teardown. Whether the loop escaped depended on whether requests were still active when the sentinel was drained, which made the resulting teardown hang intermittent. Select a non-blocking timeout once is_shutdown is set, so the iteration completes and the loop reaches its exit check. Requests still in flight continue to drain as before. Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
trtllm-agent
requested review from
JunyiXu-nv,
asfiyab-nvidia,
nv-xtf and
reasonsolo
August 7, 2026 17:34
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
WalkthroughThe executor request-fetch condition now checks ChangesExecutor shutdown handling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Open
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
idleonnot self.is_shutdownso a non-blocking timedelta(0) is selected once shutdown is set, letting the loop reach its exit check while in-flight requests still drain normally.pytest tests/unittest/llmapi/test_llm.py::test_generate_with_detokenization_stop_words_streaming -vTest plan
Links
Dev Engineer Review
PyExecutorrequest fetching to avoid an unboundedrequest_queue.get()after shutdown.QA Engineer Review
No test changes.