Anurag-S1ngh commented on code in PR #77085:
URL: https://github.com/apache/airflow/pull/77085#discussion_r4652695468


##########
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:
   Fixed. `trigger_id` is added back only when the line has no log file and 
falls back to the triggerer's output. `watched_assets` is still added for 
watcher lines, and a new test covers the file path so the duplicate keyword 
stays out.



##########
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:
   Intended. When a trigger has a log file, lines about it go there, which is 
what `cleanup_finished_triggers` already does on main for `Trigger exited with 
error`, `Trigger failed to inflate` and `Trigger returned a TriggerEvent...`. 
Lines with no file to go to, like `Trigger disappeared before we could start 
it`, still go to the triggerer's output and now carry `trigger_id`. Say if you 
want the lifecycle lines in the output as well and I will add a routing flag.



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