seanmuth commented on PR #69058: URL: https://github.com/apache/airflow/pull/69058#issuecomment-4848028416
Rebased onto current `main` to resolve the conflict introduced by #68674 (`25c0b3f`). **What #68674 changed under this PR:** it fixed the never-drained adoption set by converting `self.completed` from a `set` → `dict[(namespace, pod_name), KubernetesResults]`, and reworked `sync()` to drain it via a keep-failures loop (`_change_state` is retried next sync if it raises, otherwise the entry is dropped). It did *not* touch `_change_state` itself — so the only real textual overlap with this PR was in `__init__` (the `self.completed` declaration sits next to the new requeue state) plus an unrelated `coordinator_kube_image` arg `main` had added to `KubernetesJob` in `execute_async`. **How I reconciled it:** - `__init__`: kept `pod_launch_attempts` and adopted the new `self.completed: dict[(namespace, pod_name), ...]` type. - `execute_async`: built the job with the new `coordinator_kube_image` arg *and* registered its `_PodLaunchAttempt`. - `_change_state` / helpers / tests: merged cleanly (non-overlapping regions). **Why it composes correctly (not just a marker resolution):** - The requeue branch only fires on `state == FAILED`; adopted *completed* pods carry `state == "completed"`, so they drain through #68674's new loop untouched. - The requeue path `return`s rather than raising, so a requeued task is dropped from `self.completed` instead of lingering in the new keep-failures dict. - Adopted pods have no `pod_launch_attempts` entry, so a pre-execution failure on them falls through to a normal fail — consistent with the ephemeral-state semantics documented on `pod_launch_attempts`. Verified locally: `ruff` clean, full `test_kubernetes_executor.py` class passes (142 passed, 1 skipped — the pre-3.2 gate). <sub>Rebase performed by Claude (Opus 4.8), reviewed by me.</sub> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
