AIP-97 POC: dedicated infra_retry_count counter vs refund-max_tries (open question) - #8
AIP-97 POC: dedicated infra_retry_count counter vs refund-max_tries (open question)#81fanwang wants to merge 1 commit into
Conversation
…d-max_tries) Adds an infra_retry_count column + migration. On an infra failure the bounded counter increments instead of bumping max_tries; is_eligible_to_retry becomes try_number <= max_tries + min(infra_retry_count, cap). max_tries stays == task.retries, so the user's retry number never gets inflated. Same behavior as the refund approach, cleaner data model, one column + migration. 5 deterministic unit tests + a live LocalExecutor run. Signed-off-by: 1fanwang <1fannnw@gmail.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Superseded by #17, the current dedicated-counter cut (open question 2, handles retries=0). Closing; branch kept. |
AIP-97 POC — dedicated infra counter vs refund-max_tries
This branch POCs the AIP-97 open question: refund
max_tries(the shipped approach in #6/#7) versusa dedicated
infra_retry_countcolumn that never touches the user's retry number.The one difference
Both give the same retry behavior — an infra disruption extends eligibility so the user's code
still gets its full
retries. The difference is the data model:max_tries(#6/#7)max_tries1 → 2 (inflated)max_triesstays 1;infra_retry_count0 → 1retriesstill readable on the TI?max_triesmax_tries==retriesalwaysis_eligible_to_retrybecomestry_number <= max_tries + min(infra_retry_count, cap);max_triesis never mutated.
Live e2e — the cap, on a real KubernetesExecutor cluster
Counter branch deployed in-cluster on kind (Postgres + api-server + dag-processor + scheduler as
pods, KubernetesExecutor,
max_infra_refunds=3). Migration0127applies clean on real Postgres(
infra_retry_countcolumn present).k8s_sleep(retries=1) disrupted by real pod force-deletes,one snapshot each:
infra_retry_countclimbs 1→2→3 and the cap stops it;max_triesnever leaves 1. On the identicalscenario the refund branch (#6/#7) took
max_tries1→4. Retry behavior is identical (bothsurvive
retries + cap= 4 refunded attempts); only the data model differs — the counter keeps theuser's
retrieslegible on the row. The deterministic cap math is also unit-pinned (5 tests).Unit tests (deterministic — the cap + pristine max_tries)
test_taskinstance_infra_counter.py, 5 cases:infra_retry_count,max_triesunchangedmax_triesnever movesretries=Nonedoesn't crashRecommendation for the AIP
Lead with the refund (minimal, no migration, ships the behavior); offer the dedicated counter as the
cleaner data model when reviewers want the user's
retriesto stay legible. This POC shows thecounter costs exactly one column + a migration and changes no behavior.