namanjain24-sudo commented on PR #75423:
URL: https://github.com/apache/airflow/pull/75423#issuecomment-7114739216

   Still on it, sorry for the gap. Rebased on `main` and pushed a revision 
addressing all four of
   @dabla's points.
   
   **[1]** Right, and reachable rather than theoretical: `ti_put_rtif` 
documents a 410 for a task
   instance cleared meanwhile, and that error reaches the runner as a raised 
`AirflowRuntimeError`,
   which `run_trigger` re-raises. The `asend` is inside the `try` now. 
Reverting just that move ends
   the trigger before it fires its event.
   
   **[2]** The harness was the cause, as you said: 
`InProcessTriggerComms.asend` built its frame
   without `ti_id`, so `_handling_trigger_ti_id` was `None` and the write was 
skipped but answered OK.
   It stamps `ti_id` like the real decoder now, and the test asserts the 
`set_rtif` call with the task
   instance id instead of asserting the runner sent a message. Two tests added 
from your comment: a
   rejected write still fires the event, and fields with no task instance in 
scope are dropped — with
   a warning there now, since the runner sees no difference either way.
   
   **[3]** Moved into the module-top statement that already imports 
`RuntimeTaskInstance`, so no
   `# noqa: SDK001` and the recorded import count is unchanged. The `# type: 
ignore[arg-type]` stays
   and is explained in the PR body.
   
   **[4]** Fixed.
   
   PR body rewritten — it still described the first version.
   
   @kaxil your three threads are resolved: the rewrite records what 
`BaseTrigger` already rendered
   instead of rendering the serialized operator, and the test goes through the 
serialized Dag. Your
   changes-requested review is still standing if you have a moment.
   
   `test_triggerer_job.py`: 343 passed, 1 skipped (needs postgres). `prek` 
clean on both stages,
   `mypy-airflow-core` clean.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @namanjain24-sudo 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