fix(scheduler): fail running jobs when all executors are lost - #2212
fix(scheduler): fail running jobs when all executors are lost#2212akshaychitneni wants to merge 1 commit into
Conversation
|
Thanks for picking this up — the diagnosis is right and the shape of the fix (bounded wait, scoped to the Disclosure: this review was produced with LLM assistance (Claude Code). Code references were checked against the tree; the Scenario G timing analysis below is derived from reading the code, not from an executed run. First: there's already a regression test for this, and it's waiting on you#2026 added an HA chaos harness whose whole purpose was to drive these fault-tolerance paths on a real multi-process cluster, and #2029 is one of the three bugs it surfaced. It ships a dedicated reproducer:
#[ignore = "reproduces #2029: killing every executor hangs the job instead of failing it"]
By my reading it should pass as-is, with no assertion changes:
Suggested follow-through:
Worth being explicit about what Scenario G does not cover, because it's blind to finding 1 below: it kills two executors and asserts only that the job terminates, so it passes even with duplicate failure events. It also never exercises the recovery path (executor returns inside the grace window), which is the actual new behaviour being introduced. Review findings1. Duplicate grace timers → N
|
|
Thanks for the contribution @akshaychitneni. Sorry for the long AI review above. I would start with enabling the existing test and see if that passes. We can address other points in follow on PRs potentially. Let me know what you think. |
|
Minor design related question: Is there a strong reason to distinguish between a cluster that has not registered its first executor and one that has lost all registered executors? From the perspective of a running job, both cases appear equivalent: there are no executors available and the job cannot make progress. Would it be cleaner to apply the same configurable grace period in both cases, rather than allowing jobs submitted before the first executor appears to wait indefinitely? This would also bound failures caused by executor startup or configuration problems. |
Sure. I will work in integrating with test harness. |
This is a good callout. From a running job's view they are equivalent. I would keep them separate for now because "lost all executors" has an ExecutorLost event to trigger on, while "no first executor yet" has no event and would need a different mechanism (like a startup timeout). This is also already mitigated on k8s by the existing /readyz probe, which keeps an executor-less scheduler out of the k8s service and not accept jobs from clients |
…#2029) When every executor dies mid-query, the scheduler reset the affected tasks but had nothing to schedule them onto, leaving the job Running forever and hanging the client. On ExecutorLost, if no live executors remain, wait a bounded, configurable grace period (no_executors_grace_period_seconds, default 30s) for an executor to (re)register, then fail any still-running job with a clear error. The check is scoped to the ExecutorLost path, so jobs merely queued waiting for their first executor (autoscaling cold start) are unaffected. Adds unit tests for both total loss (job fails) and partial loss (job survives while an executor remains).
3fb5611 to
07512e8
Compare
When every executor dies mid-query, the scheduler reset the affected tasks but had nothing to schedule them onto, leaving the job Running forever and hanging the client.
On ExecutorLost, if no live executors remain, wait a bounded, configurable grace period (no_executors_grace_period_seconds, default 30s) for an executor to (re)register, then fail any still-running job with a clear error. The check is scoped to the ExecutorLost path, so jobs merely queued waiting for their first executor (autoscaling cold start) are unaffected.
Adds unit tests for both total loss (job fails) and partial loss (job survives while an executor remains).
Which issue does this PR close?
Closes #. #2029
Rationale for this change
When all executors die mid-query, the scheduler leaves the job
Runningforever and the client hangs.What changes are included in this PR?
On
ExecutorLostwith no live executors left, wait a bounded, configurable grace period (no_executors_grace_period_seconds, default 30s) for an executor to re-register, thenfail any still-running job.
Are there any user-facing changes?
New scheduler config
no_executors_grace_period_seconds(default 30s); a total executor loss now fails jobs with a clear error instead of hanging.