feat: coordinate heavy local accelerator jobs - #4281
Merged
Conversation
Owner
Author
|
Required Antigravity review could not complete after three attempts. The |
The test mocks fileUtils.js down to PATHS.imageTo3d alone, but models.js also imports claimHeavyLocalJob from heavyJobClaim.js, which reads PATHS.data at module load time. With PATHS.data undefined, the real heavyJobClaim.js threw at import and failed the whole test file in CI. models.test.js already mocks heavyJobClaim.js the same way; this test file needed the same mock.
…vy-job claim runTraining() acquired a fresh machine-wide accelerator claim before checking reattach:true. On a server restart that re-attaches to a detached trainer which survived the crash, that trainer's own PID already holds the claim (handed off pre-restart), so the fresh claimHeavyLocalJob() call saw it as a competing job and refused — failing every restart-survived training run outright, even though it was actively still training. Add adoptHeavyLocalJob() to recognize and adopt an on-disk claim already recorded for this exact kind/id/pid instead of contending for a new one; fall back to a fresh claim only when no matching claim survived (e.g. a run predating this feature).
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
Test plan
vitest run server/lib/heavyJobClaim.test.js server/services/loraTraining/memoryPrep.test.js server/services/imageTo3d/models.test.js server/lib/index.test.js --reporter=dotvitest run server/services/videoGen/local.test.js --reporter=dotnode --checkfor changed server modulesCloses #4174