alexandrusoare commented on code in PR #42481:
URL: https://github.com/apache/superset/pull/42481#discussion_r3681754750


##########
superset/commands/report/execute.py:
##########
@@ -1403,6 +1564,8 @@ def next(self) -> None:
             warning_message = (
                 ";".join(self._filter_warnings) if self._filter_warnings else 
None
             )
+            # Clear any retry state from previous failed attempts in this 
window.
+            self._reset_retry_counter()

Review Comment:
   added retry logic, thank you



##########
superset/daos/report.py:
##########
@@ -285,11 +285,34 @@ def update(
     @staticmethod
     def find_active() -> list[ReportSchedule]:
         """
-        Find all active reports.
+        Find all active reports. Excludes reports that are currently retrying
+        unless their retry window has gone stale (retry task crashed or was
+        lost), in which case they are re-included so the scheduler can
+        recover them on the next crontab tick.
         """
+        from flask import current_app  # noqa: PLC0415
+
+        # A retry is considered stale if retry_scheduled_dttm is older than
+        # the maximum possible delay plus a generous buffer.
+        max_delay: int = current_app.config.get(
+            "ALERT_REPORTS_RETRY_MAX_DELAY_SECONDS", 3600
+        )
+        stale_cutoff = datetime.now(tz=timezone.utc).replace(tzinfo=None) - 
timedelta(
+            seconds=max_delay * 2

Review Comment:
   took care of it



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to