fix: Ensemble requests stuck indefinitely when the step max_queue_size exceeded - #466
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses a critical issue where ensemble requests could hang indefinitely when step max_queue_size limits were exceeded. The fix ensures proper error handling and cleanup by allowing completed steps to be consumed even after errors occur, preventing inflight counter deadlocks.
Changes:
- Modified
PrepareStepsto always process completed steps for proper cleanup, even when ensemble has failed - Added
error_response_sent_flag to prevent duplicate error responses - Enhanced error handling to preserve original error status while still cleaning up in-flight steps
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
whoisj
left a comment
There was a problem hiding this comment.
I am slightly confused here. Does this fix the problem or just turn full queues into error conditions?
|
Test case? |
Please refer to PR triton-inference-server/server#8631 |
|
How could |
We can exceed the |
Why did it hang before instead of rejecting the request (which line)? Did |
Very good question and something I would think we should be concerned more about. |
|
Should add that to the PR description. |
yinggeh
left a comment
There was a problem hiding this comment.
Left some comments. LGTM in general
…into spolisetty/tri-654-bug-in-ensemble-scheduler-when-using-dynamic-batcher
This PR addresses a critical issue where ensemble requests could hang indefinitely when the step
max_queue_sizelimits were exceeded. The fix ensures proper error handling and cleanup by allowing completed steps to be consumed even after errors occur, preventing in-flight counter deadlocks.Changes:
CI: triton-inference-server/server#8631
Background:
max_queue_sizeworked correctly, and the request was properly rejected with an error status. However, the ensemble scheduler had a critical bug that prevented proper cleanup after rejection, causing the hang. Whenensemble_status_was updated to unhealthy,UpdateEnsembleState()calls were skipped, and responses were not consumed, soinflight_step_counter_never reached zero, and the request remained stuck indefinitely.https://github.com/triton-inference-server/core/pull/466/changes#diff-ce8a574cf83a8bc8293e1be3573c9fb2d84cc681a8f6c6a66503bd844570934eR969
https://github.com/triton-inference-server/core/pull/466/changes#diff-ce8a574cf83a8bc8293e1be3573c9fb2d84cc681a8f6c6a66503bd844570934eR1338