fat-catTW commented on code in PR #71214:
URL: https://github.com/apache/airflow/pull/71214#discussion_r4640045448
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -1453,25 +1454,19 @@ def _enqueue_executor_callbacks(self, session: Session)
-> None:
# Can't happen since we queried ExecutorCallback, but
satisfies mypy.
continue
- # TODO: Add dagrun_id as a proper ORM foreign key on the
callback table instead of storing in data dict.
- # This would eliminate this reconstruction step. For
now, all ExecutorCallbacks
- # are expected to have dag_run_id set in their data dict
(e.g., by Deadline.handle_miss).
- if not isinstance(callback.data, dict) or "dag_run_id" not in
callback.data:
+ if callback.dagrun_id is None:
self.log.error(
- "ExecutorCallback %s is missing required 'dag_run_id'
in data dict. "
- "This indicates a bug in callback creation. Skipping
callback.",
- callback.id,
+ "Executor callback is missing dagrun_id.",
+ callback_id=callback.id,
)
continue
Review Comment:
Implemented.
Callbacks without `dagrun_id` are now marked `FAILED` with an output
message, so they are not fetched and logged again on every scheduler loop.
--
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]