-
-
Notifications
You must be signed in to change notification settings - Fork 37
fix: update job closures for all completed builds to prevent schedule… #491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…r deadlock The scheduler was only updating job_closures for failed builds, causing it to potentially wait indefinitely for dependencies that had already completed successfully. This resulted in builds hanging when successful dependencies weren't properly removed from the closure tracking. - Rename _handle_failed_job to _handle_completed_job for clarity - Move job_closures update to run after ALL completed jobs (success/failure) - Ensure closure update happens after get_failed_dependents to maintain integrity
WalkthroughRefactors failure-specific handling into a unified completion handler. The run loop now calls _handle_completed_job, which processes both successes and failures. Failure caching is explicitly gated by result checks. Dependent-failure scheduling occurs before closure updates. Removed jobs logging is conditional. Closures are updated for all completed jobs. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant RL as RunLoop
participant BT as BuildTrigger
participant HC as _handle_completed_job
participant DB as FailedBuildsDB
participant SCH as Scheduler/Queue
RL->>BT: on job completion (job, result)
BT->>HC: _handle_completed_job(job, ctx, brids, result)
alt Job is not NixEvalJobSuccess
HC-->>BT: return (no-op)
else Job is NixEvalJobSuccess
opt result == FAILURE
HC->>DB: cache failed build URL with timestamp (if configured)
HC->>SCH: compute failed dependents
loop for each failed dependent
HC->>SCH: schedule dependency-failure
end
HC->>BT: extend BRIDs map
end
HC->>BT: update job closures (all completed jobs)
opt any removed jobs
HC->>BT: log removed jobs
end
HC-->>BT: done
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)buildbot_nix/buildbot_nix/build_trigger.py (2)
🔇 Additional comments (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…r deadlock
The scheduler was only updating job_closures for failed builds, causing it to potentially wait indefinitely for dependencies that had already completed successfully. This resulted in builds hanging when successful dependencies weren't properly removed from the closure tracking.
Summary by CodeRabbit