fix(orchestrator): propagate dispatcher and watcher failures#2986
Open
morluto wants to merge 1 commit into
Open
fix(orchestrator): propagate dispatcher and watcher failures#2986morluto wants to merge 1 commit into
morluto wants to merge 1 commit into
Conversation
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
The orchestrator runs its dispatcher and weight watcher as background tasks. If
either task raises, the exception remains stored on the task while the main loop
continues waiting for rollouts.
Inspect these component tasks from the main loop and propagate failures with the
component name and original exception preserved.
Failure mode
The weight watcher has a reachable uncaught failure path:
WeightWatcher.apply_policy_update()awaitsInferencePool.update_weights().WeightWatcher.start()terminates because itonly handles cancellation.
TARGET_LAG,dispatch_allowedis cleared.Without another policy update, the gate cannot reopen.
If the dispatcher task raises, no loop remains to collect completed rollout
tasks and put them on
out_q. The main loop instead continues retrying itsqueue timeout.
Individual rollout-task failures are handled separately by converting them into
errored rollouts. That behavior is unchanged.
Fix
RuntimeErrorwhen either task contains an exception.When the rollout queue is idle, failures are detected within its existing
0.5-second polling interval.
Verification
test_raise_for_failed_component_tasks_preserves_cause.its
ConnectionErroris preserved as the cause of the orchestrator error.tests/unit/orchestrator/test_orchestrator_setup.py: 3 passed.ruff checkpassed.ruff format --checkpassed.git diff --checkpassed.Note
Medium Risk
Changes orchestrator liveness by failing fast when core pipeline tasks die, which is desirable but alters long-running run behavior on weight-update or dispatch errors.
Overview
Background dispatcher and weight watcher tasks could exit with an exception while the orchestrator main loop kept polling the rollout queue, leading to silent stalls (e.g. dispatch gate closed after a failed weight update with no recovery).
Each main-loop iteration now calls
raise_for_failed_component_tasksoncomponent_tasks, which raises aRuntimeErrornaming the failed task and chains the original exception as__cause__. Pending and cancelled tasks are ignored.A unit test verifies the named error and preserved cause for a failed
"watcher"task.Reviewed by Cursor Bugbot for commit d2f58c8. Bugbot is set up for automated code reviews on this repo. Configure here.