Lioscro commented on code in PR #38666:
URL: https://github.com/apache/airflow/pull/38666#discussion_r1550656016


##########
airflow/jobs/triggerer_job_runner.py:
##########
@@ -672,6 +672,17 @@ def update_triggers(self, requested_trigger_ids: set[int]):
                 self.failed_triggers.append((new_id, e))
                 continue
 
+            # If new_trigger_orm.task_instance is None, this means the 
TaskInstance
+            # row was updated by either Trigger.submit_event or 
Trigger.submit_failure
+            # and can happen when a single trigger Job is being run on 
multiple TriggerRunners
+            # in a High-Availability setup.
+            if new_trigger_orm.task_instance is None:
+                self.log.warning((
+                    "TaskInstance for Trigger ID %s is None. It was likely 
updated by another trigger job. "
+                    "Skipping trigger instantiation."
+                ), new_id)

Review Comment:
   I was trying to follow style of the warning message prior to this, where a 
warning message is printed if the trigger disappeared before it could be 
started, which is also normal behavior if the Trigger was cleaned up by a 
different triggerer.
   
https://github.com/apache/airflow/blob/6c217ae342e6f86bb4cb448bfd73d5f97cdd41f4/airflow/jobs/triggerer_job_runner.py#L664
   Happy to change the logging level if that seems more suitable for this case!



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to