akhilpratap1991 commented on issue #71272:
URL: https://github.com/apache/airflow/issues/71272#issuecomment-5263974768

   The `repr` fallback / widened `load_only` (#67822) fixes only the **first** 
read on the detached TaskInstances — the reset path still crashes on current 
`main`: `prepare_db_for_next_try()` → `TaskInstanceHistory.record_ti()` copies 
~35 columns and raises `DetachedInstanceError` on the deferred `try_number` 
(and the adopt branch reads `last_heartbeat_at` / `dag_run.conf`, neither 
loaded). Reproduced on `main` by the regression test in #71348 — without the 
fix it fails with exactly that error, no manual detaching involved: the mock 
executor just does `with create_session(): pass`, the same operation the 
released cncf provider (≤ 10.17.x, pinned by 3.2.2 constraints) performs 
mid-adoption (`_alive_other_scheduler_job_ids`), which closes the scheduler's 
thread-scoped session and detaches everything the orphan query loaded. There's 
also a second failure mode with no exception at all: writes to the detached 
instances are silently dropped, so the orphans are never actually reset 
 and get re-"reset" every scheduler loop.
   
   Fix is up in #71348 (linked, `closes` this issue; milestoned 3.3.2 with 
backport-to-v3-3) — it re-selects the rows session-bound after executor 
adoption, which covers all the reads and makes the writes persist. So I'd keep 
this open until that merges rather than closing as already-fixed.
   
   ---
   Drafted-by: Claude Code (Opus 4.8); reviewed by @akhilpratap1991 before 
posting


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