seanghaeli commented on code in PR #77087:
URL: https://github.com/apache/airflow/pull/77087#discussion_r4755579497


##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -1285,7 +1324,17 @@ def update_triggers(self, requested_trigger_ids: 
set[int]):
         )
 
         if new_trigger_ids:
-            workloads_to_create = self.build_trigger_workloads(new_trigger_ids)
+            now = time.monotonic()
+            ready_ids = {tid for tid in new_trigger_ids if 
self.failure_tracker.attempt_ready(tid, now)}

Review Comment:
   Yes please, an issue for sharing the delay would be good so it doesn't get 
lost.



##########
airflow-core/src/airflow/config_templates/config.yml:
##########
@@ -3215,6 +3215,25 @@ triggerer:
       type: integer
       example: ~
       default: "500"
+    failed_trigger_retry_delay:
+      description: |
+        Base delay, in seconds, before a failed trigger is re-created. The 
actual delay grows with the
+        trigger's consecutive failure count and is capped by ``[triggerer] 
failed_trigger_retry_max_delay``.
+        Deferred tasks' triggers still fail their task right away; this only 
delays re-creating the trigger.
+        Triggers sharing a stream back off together, so they are re-created as 
one group.

Review Comment:
   This line is still in both config descriptions (here and under 
`failed_trigger_retry_max_delay`). In Breeze a watcher that joined the failing 
stream late still never came back together with the other two, so we should 
drop it from both.
   ```suggestion
   ```



##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -844,8 +888,14 @@ def _handle_request(self, msg: ToTriggerSupervisor, log: 
FilteringBoundLogger, r
                 self.failed_triggers.extend(msg.failures)
                 now = time.monotonic()
                 for trigger_id, _ in msg.failures:
-                    self.failure_tracker.record_failure(trigger_id, now)
+                    consecutive = 
self.failure_tracker.record_failure(trigger_id, now)
                     self.recovered_triggers.discard(trigger_id)
+                    log.info(
+                        "Trigger failed, re-creating it once its backoff has 
passed",

Review Comment:
   Small thing: this also logs for a deferred task's trigger, which never gets 
re-created. In Breeze a task deferring to a failing trigger got `Trigger 
failed, re-creating it once its backoff has passed ... retry_in=5.0`, and the 
task then failed right away as it should. Could we skip the line for task 
triggers, or word it so it doesn't promise a re-create?



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