Batch retry schedulability probes per scheduling round - #5097
Open
dejanzele wants to merge 6 commits into
Open
Conversation
|
Contributor
Greptile SummaryThe PR moves retry schedulability decisions into a per-round planning pass, reducing repeated checker work while preserving retry mutations and terminal reasons.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the prior deadline-omission and cross-queue verdict-leakage issues are addressed in the current code.
|
| Filename | Overview |
|---|---|
| internal/scheduler/scheduler.go | Introduces round-level retry planning, batched representative probes, partial-result handling, and shared queue-policy lookup without leaving the previously reported failures reachable. |
| internal/scheduler/retry_policy_test.go | Routes retry tests through the batch entry point and adds coverage for batching, queue-separated classes, and repeated partial probes. |
| internal/scheduler/scheduler_test.go | Adds full-cycle retry-policy coverage and expands the submit-checker fixture to model call counts and omitted partial results. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Failed jobs in scheduling round] --> B[Evaluate retry policy per job]
B --> C[Collect memory-bump candidates]
C --> D[Probe representatives by queue and scheduling key]
D --> E[Collect node-affinity candidates]
E --> F[Probe representatives by queue and scheduling key]
F --> G[Generate retry or terminal events from plans]
D -->|No result after retries| H[Keep granted retry and mutation]
H --> E
Reviews (8): Last reviewed commit: "Abort test transactions with t.Cleanup i..." | Re-trigger Greptile
dejanzele
force-pushed
the
batch-retry-schedulability-probes
branch
from
August 5, 2026 22:05
038827a to
b2a3594
Compare
Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
dejanzele
force-pushed
the
batch-retry-schedulability-probes
branch
from
August 5, 2026 22:22
b2a3594 to
3bab50e
Compare
…for the job Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
…the whole class Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
…ier call did not reach Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
dejanzele
force-pushed
the
batch-retry-schedulability-probes
branch
from
August 6, 2026 16:21
493b844 to
44d3db6
Compare
…resource limit Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
dejanzele
force-pushed
the
batch-retry-schedulability-probes
branch
from
August 7, 2026 13:28
b6347c7 to
bf6c7c0
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.
When the retry engine is on, a mutation retry probes schedulability through
SubmitChecker.Checkonce per job, inside the scheduling cycle. Under a mass failure, hundreds of failed jobs produce hundreds of probe calls in one cycle, and cycle time is the scheduler's main performance limit. Each consumer in the cycle also rebuilds the queue-to-policy map.Earlier work:
The solution moves the retry decision into a planning pass.
planRetryDecisionsresolves the decision for every failed run in the round: one engine evaluation per job, then at most two batchedCheckcalls for the whole round, one for memory-grown candidates and one for node-anti-affinity candidates. The two calls stay separate because each gate has its own terminal reason.generateUpdateMessagesFromJobconsumes the plans. A job without a plan falls back to the per-job path and logs a warning. A future drift between the planning guard and the failure branch thus degrades to the slow path, and the behavior stays correct. The checker returns partial results when it reaches its time limits. The limits apply per call, so the probe asks again with a fresh budget, up to three calls, for the representatives an earlier call did not reach. A job that stays unprobed after that keeps its granted retry and its mutation: an absent result means "not probed", not "unschedulable". The probe also checks one representative per queue and scheduling key and applies the verdict to the whole class, because the key covers the placement requirements and the checker applies a per-queue resource limit. A mass failure affects many jobs of few distinct shapes, so the probe cost scales with the number of shapes, not with the number of jobs, and the time limits stay out of reach. The cycle builds the queue-to-policy map once and passes it to the update messages and the expiry sweep.Tests:
Scheduler.cyclewith the flag on: the engine grants the retry, a retryable failure event goes out, and the job requeues.Validation on a live stack (compose plus kind): I built the scheduler from this branch and ran the four retry testsuite cases from #5007 against it. All four pass in 1m34s, including the OOM memory bump to success and the retry-limit exhaustion walk.