AIP-97 POC: classify a missed heartbeat as infra (executor-agnostic) - #29
Open
1fanwang wants to merge 1 commit into
Open
AIP-97 POC: classify a missed heartbeat as infra (executor-agnostic)#291fanwang wants to merge 1 commit into
1fanwang wants to merge 1 commit into
Conversation
Signed-off-by: 1fanwang <1fannnw@gmail.com>
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.
Why
AIP-97's answer to "does this only help Kubernetes" is that there are two tiers: a universal
floor every executor gets for free, and an opt-in ceiling for executors that can read a precise
cause (Kubernetes in apache#66405, Celery in #15, ECS in #28).
This is the floor, refreshed onto the current no-DB design. When a worker is killed outright it
reports nothing, so no executor can name the cause — but the scheduler already notices the missing
heartbeat and fails the task. That purge is the one classification point that needs no pod, no
backend API, and no executor code at all.
What changed
The heartbeat-timeout purge passes
failure_kind=INFRAandreason="HeartbeatTimeout"tohandle_failure. Nothing else moves.This is the same idea as #14, re-cut on the current head:
that POC predates the no-DB reconciliation and still passes the dropped
infra_reason=argument.Refs
Testing Done
retries=0up_for_retry,max_tries 0->1failed,max_tries 0->0Live Postgres 16, real scheduler purge
Drives the real
_find_task_instances_without_heartbeats()and_purge_task_instances_without_heartbeats()pair against a real database with a real registeredlistener. The executor is a
MagicMockfor the callback sink only, mirroring the existing upstreampurge tests; it takes no part in the classification, which is the point.
Scenario 1 uses
retries=0, so the refund is what rescues it at all. With the flag off the kindstill reaches the listener, which is the alerting case working with no behavior change.
Committed unit test
Evidence script (inline, so it can be re-run)