seanghaeli commented on code in PR #77085:
URL: https://github.com/apache/airflow/pull/77085#discussion_r4651335853
##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -1327,6 +1338,9 @@ def get_logger(trigger_id: int) -> WrappedLogger:
if trigger_id := event.pop("trigger_id", None):
log = get_logger(trigger_id)
+ event["trigger_id"] = trigger_id
Review Comment:
Once rebased onto #76527 this breaks watcher logging:
`TriggerLoggingFactory.log` already passes `trigger_id=self.trigger_id`, so the
first watcher line raises `TypeError: ... got multiple values for keyword
argument 'trigger_id'` and the reader stops after it (merged with main, seven
of the `TestWatcherLogFile` tests fail the same way). Watcher lines already
carry the id on main, so only `watched_assets` needs adding here.
##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -1995,26 +2009,36 @@ async def run_trigger(
if timeout := timeout_after:
timeout = timeout.replace(tzinfo=timezone.utc) if not
timeout.tzinfo else timeout
if timeout < timezone.utcnow():
- await self.log.aerror("Trigger cancelled due to
timeout")
+ await self.log.aerror("Trigger cancelled due to
timeout", trigger_id=trigger_id)
Review Comment:
Putting `trigger_id` on the runner's own lines also changes where they go,
since the supervisor uses it to pick the trigger's file. For a deferred task,
this line and `Trigger failed to load code`, `on_kill() timed out` and `trigger
completed` now land only in the task's trigger log, not in the triggerer's
output. The issue asked for these lines to carry the id in the triggerer's
output, so should they keep going there?
--
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]