niukanen1 opened a new pull request, #72826:
URL: https://github.com/apache/airflow/pull/72826

   Repeated Kubernetes watch events for a completed pod currently issue 
repeated DELETE requests. Remember recently deleted pod identities in the 
executor so duplicate results skip the DELETE while retaining task-state 
handling, adoption, and pre-execution retries. Carry the Kubernetes UID through 
watcher and adoption results so a newly created pod reusing the same name can 
still be deleted.
   
   The deletion history is local to one executor and limited to 10,000 
identities. Events received after eviction or executor restart may issue 
another DELETE. Legacy result producers that omit the optional UID cannot 
distinguish reused pod names.
   
   Fixes #72803.
   
   Validation:
   
   - The regression reproduced three DELETE calls on the original 
implementation, where one was expected.
   - Python 3.12: 61 focused executor/watcher/adoption tests passed, including 
repeated success/404 events, failed deletion retry, distinct pod UIDs, and 
pre-execution retries.
   - `prek run --stage pre-commit` on the four staged files: 43 hooks passed; 
pre-commit and commit-msg hooks also passed during commit.
   - Manual hooks: three passed; `mypy-providers` stopped before type checking 
because `breeze` was not on PATH. Docker is also unavailable locally, so 
provider mypy remains unverified.
   - `breeze ci selective-check --commit-ref HEAD --github-event-name 
pull_request` completed; its broader provider, compatibility, and Kubernetes 
selections were not all executed locally.
   - No live Kubernetes cluster or full supported-version matrix was run; 
upstream CI remains necessary.
   
   Focused test command (Python 3.12, frozen Kubernetes provider environment):
   
   ```shell
   pytest 
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/executors/test_kubernetes_executor.py
 \
     -k 'change_state or sync_processes_completed_pods or adopt_completed_pods 
or process_status' --tb=short
   ```
   
   ---
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes (please specify tool below)
   
   Generated-by: OpenAI Codex Desktop (client 0.153.4), GPT-6 Astra 
(`gpt-6-astra`), reasoning effort `ultra`.
   


-- 
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]

Reply via email to