[v3-3-test] Fix scheduler firing on_failure_callback for heartbeat-timed-out retries (#66767)#69824
Merged
Merged
Conversation
…med-out retries (#66767) When a worker stops heartbeating (OOMKill, node eviction), the scheduler's ``_purge_task_instances_without_heartbeats`` built a ``TaskCallbackRequest`` without ``task_callback_type``. The Dag processor's task-callback dispatch branches on that field: ``UP_FOR_RETRY`` runs ``on_retry_callback``, anything else (including ``None``) runs ``on_failure_callback``. So heartbeat-timeout cleanup always fired ``on_failure_callback`` even when the task still had retries remaining, producing spurious failure alerts for tasks that ultimately succeeded on retry. Set ``task_callback_type`` from ``ti.is_eligible_to_retry()``, the canonical retry-eligibility predicate, guarded by ``max_tries > 0``. The guard covers the one gap the predicate has here: this path doesn't load ``ti.task``, so the predicate falls back to ``try_number <= max_tries`` and drops the retries-configured check its task-loaded branch applies. Deferring to the predicate also keeps a ``RESTARTING`` task (cleared while running) retry- eligible past ``max_tries``, where a hand-rolled ``try_number <= max_tries`` check would have fired ``on_failure_callback``. closes: #65400 (cherry picked from commit f2403cc) Co-authored-by: Stefan Wang <1fannnw@gmail.com> Signed-off-by: 1fanwang <1fannnw@gmail.com> Co-authored-by: kimhaggie <kimhaggie@gmail.com>
Contributor
Author
|
Hi maintainer, this PR was merged without a milestone set.
|
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 a worker stops heartbeating (OOMKill, node eviction), the scheduler's
_purge_task_instances_without_heartbeatsbuilt aTaskCallbackRequestwithout
task_callback_type. The Dag processor's task-callback dispatchbranches on that field:
UP_FOR_RETRYrunson_retry_callback, anythingelse (including
None) runson_failure_callback. So heartbeat-timeoutcleanup always fired
on_failure_callbackeven when the task still hadretries remaining, producing spurious failure alerts for tasks that
ultimately succeeded on retry.
Set
task_callback_typefromti.is_eligible_to_retry(), the canonicalretry-eligibility predicate, guarded by
max_tries > 0. The guard coversthe one gap the predicate has here: this path doesn't load
ti.task, so thepredicate falls back to
try_number <= max_triesand drops theretries-configured check its task-loaded branch applies. Deferring to the
predicate also keeps a
RESTARTINGtask (cleared while running) retry-eligible past
max_tries, where a hand-rolledtry_number <= max_triescheck would have fired
on_failure_callback.closes: #65400
(cherry picked from commit f2403cc)
Co-authored-by: Stefan Wang 1fannnw@gmail.com
Signed-off-by: 1fanwang 1fannnw@gmail.com
Co-authored-by: kimhaggie kimhaggie@gmail.com