seanmuth commented on PR #69058:
URL: https://github.com/apache/airflow/pull/69058#issuecomment-4860026199

   Pushed `797256b18c` to fix two CI failures from the rebased run:
   
   **1. K8s system tests** — 
`test_pod_failure_logging_with_container_terminated` and 
`test_pod_failure_logging_exception_handling` failed with 
`sqlite3.OperationalError: no such table: task_instance`. Root cause was mine: 
the pre-execution-failure check ran a metadata-db lookup 
(`_get_task_instance_state`) for *every* `FAILED` pod, but those tests call 
`_change_state` directly with a `FAILED` result against a DB with no 
`task_instance` table (previously the lookup only ran when `state is None`).
   
   Fix — and a genuine improvement: reorder the guard so the cheap in-memory 
`pod_launch_attempts.get(key)` check runs first, and the DB lookup only happens 
when there's actually an attempt to requeue. Adopted pods, already-finalized 
pods, and directly-injected results have no entry, so they skip the query 
entirely and fall through to the normal fail path.
   
   ```python
   # Only pods this executor launched and is still tracking can be requeued; 
checking the
   # in-memory attempt first avoids a metadata-db lookup for adopted or 
already-finalized pods.
   attempt = self.pod_launch_attempts.get(key)
   if (
       attempt is not None
       and state == TaskInstanceState.FAILED
       and self.pod_launch_failure_max_retries != 0
       and self._is_pre_execution_failure(...)
   ):
       ...
   ```
   
   **2. Docs spellcheck** — `requeues` flagged in the cncf-kubernetes 
changelog. The singular `requeue`/`requeued` were already whitelisted; added 
the plural to `docs/spelling_wordlist.txt` (per 
`devel-common/src/docs/README.rst`, the wordlist is the right place for prose 
words — the backtick convention is only for class/function names).
   
   Verified locally: `ruff` clean, prek hooks pass, 61 relevant unit tests pass 
(including the disabled-skips-lookup and dedupe cases).
   
   <sub>Changes 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]

Reply via email to