Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
| if ( | ||
| !job || | ||
| job.status !== "rendering" || | ||
| state.duplicateOf || |
There was a problem hiding this comment.
Lost hedges cannot be replaced
Retiring a dead hedge leaves its primary's duplicated flag set. straggler() skips primaries with that flag, so it cannot spawn the fresh hedge promised by this fix. When the hedge worker disappears while the primary stays slow or frozen, spare workers stay idle instead of replacing the lost hedge.
Make the primary eligible for a safe replacement hedge and cover that sequence in the regression test.
Knowledge Base Used: Render-farm processing
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/render-farm/src/coordinator.ts
Line: 1552
Comment:
**Lost hedges cannot be replaced**
Retiring a dead hedge leaves its primary's `duplicated` flag set. `straggler()` skips primaries with that flag, so it cannot spawn the fresh hedge promised by this fix. When the hedge worker disappears while the primary stays slow or frozen, spare workers stay idle instead of replacing the lost hedge.
Make the primary eligible for a safe replacement hedge and cover that sequence in the regression test.
**Knowledge Base Used:** [Render-farm processing](https://app.greptile.com/-/switch-tenant?tenant=cap&next=%2Fcustom-context%2Fknowledge-base%2Fcapsoftware%2Fcap%2F-%2Fdocs%2Frender-farm-processing.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Good catch. Updated requeue() and the expired resume-hold sweep to clear original.duplicated, preserved monotonic attempts when straggler() creates a replacement hedge, capped hedging at chunk.dispatches < PART_RANGES - 1 so replacement hedges cannot exhaust upload ranges, and extended the regression test to cover replacement dispatch and the range cap.
|
hey @greptileai, please re-review the PR |
Closes #4874
When a worker running a speculative hedge task died or the coordinator restarted from its journal, the coordinator put the hedge task back onto the main work queue as if it were a primary chunk. Workers then rendered duplicate chunks that already had a primary task or had already completed.
Mark hedge tasks (
task.hedgeOfset) asdonein bothrequeue()andresumeJobs()instead of queueing them. If a chunk still lags later, the hedge loop spawns a fresh hedge under the normal rules.Before / After
requeue(hedge)after worker timeouthedge.statusbecomes"queued"andjob:v0:dupis pushed ontojob.queuehedge.statusbecomes"done"andjob.queuestays emptyresumeJobs()with a journaled primary + hedgejob.queuecontains["job:v0", "job:v0:dup"]job.queuecontains only["job:v0"]; hedge is retired as"done"Verification
bun run --cwd apps/render-farm typecheckbun test --cwd apps/render-farm src/coordinator.test.ts(38/38 passed, including the new dead/resumed hedge regression test)bun run biome check apps/render-farm/src/coordinator.ts apps/render-farm/src/coordinator.test.tsnode scripts/test-lint/run.mjsConfidence Score: 5/5

This PR appears safe to merge.Summary
This PR keeps lost and resumed hedge tasks out of the regular work queue.
Reviews (2) · Last reviewed commit: "fix(render-farm): allow safe replacement..." · Reviewed by Greptile