Control plane: stop engine instances wedged across consecutive reclaim sweeps - #53
Merged
Merged
Conversation
Contributor
|
I'll fix CI failures and address comments from users with write access that start with 'DevinAI' or '@devin'.
|
micahtyong
marked this pull request as draft
September 19, 2026 00:09
micahtyong
marked this pull request as ready for review
September 29, 2026 00:54
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The two-strike orphan reaper writes engine_strikes:<instance_id>, a key family the routed Modal store did not know, so every placement that ran a reclaim sweep failed with 'unknown key family'. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
micahtyong
force-pushed
the
devin/1789775616-reap-wedged-engines
branch
from
September 29, 2026 00:59
689b69d to
eee0625
Compare
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
Reclaim trainer instances whose idle models repeatedly fail to unload, so wedged engines eventually release their GPUs. Split out of #39.
Failed reclaim sweeps persist strikes in the engines key store. Strikes are at least three hours apart by default, matching the current backend operation timeout: rapid placement retries must not kill a healthy trainer during a long step. Any successful unload, live model, or new placement clears the strikes.
Before stopping, the engine atomically checks that its models still match the failed unloads and enters draining mode to reject new placements. Engines without the new endpoint are left running. Cancellation failures retain instance records and strikes so cleanup can retry; an already-missing Modal call can be cleaned up.
Safety review
Validation
Link to original Devin session: https://modal.devinenterprise.com/sessions/8d6804dd317c41329d77eb2c427dda6f
Requested by: @micahtyong