github-actions[bot] opened a new pull request, #66191:
URL: https://github.com/apache/airflow/pull/66191

   PR #56916 added a _eager_load_dag_run_for_validation helper that
   returns two loader options so DRDataModel.model_validate can walk
   DagRun.consumed_asset_events[*].asset and source_aliases without
   triggering lazy loads on a detached ORM instance. The helper's
   docstring example applies both loaders, and _adopt_or_reset_orphaned_tasks
   applies both. SchedulerJobRunner.process_executor_events only applies
   asset_loader and discards alias_loader, leaving
   AssetEvent.source_aliases lazy-loaded.
   
   When Celery/Kubernetes executor reports a failed-while-queued event
   for an asset-triggered DagRun whose consumed AssetEvent has a
   non-empty source_aliases collection, SQLAlchemy detaches the
   AssetEvent by the time pydantic walks the DagRun, and source_aliases
   raises DetachedInstanceError wrapped as a pydantic ValidationError.
   The exception escapes _run_scheduler_loop, the scheduler exits,
   which orphans in-flight task instances. The next scheduler's
   _adopt_or_reset_orphaned_tasks picks them up and replays the same
   validation path, crashing again.
   
   Apply alias_loader alongside asset_loader at this call site.
   
   Extend test_process_executor_events_with_asset_events so the
   AssetEvent now carries a non-empty source_aliases collection and
   the assertion verifies the alias survives into the callback payload.
   (cherry picked from commit ef0ff5cfe2bf46c853f47e676537b0d5c9ce4399)
   
   Co-authored-by: Pablo Seibelt <[email protected]>
   Co-authored-by: Claude <[email protected]>


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