ramitkataria commented on code in PR #53201:
URL: https://github.com/apache/airflow/pull/53201#discussion_r2214591000


##########
airflow-core/src/airflow/models/deadline.py:
##########
@@ -150,6 +160,36 @@ def prune_deadlines(cls, *, session: Session, conditions: 
dict[Column, Any]) ->
 
         return deleted_count
 
+    def handle_miss(self, session: Session):
+        """Handle a missed deadline by creating and starting a trigger to run 
the callback."""
+        callback_func = import_string(self.callback)
+        # TODO: Improve this check so that the callback doesn't need to be 
present on the scheduler
+        if not asyncio.iscoroutinefunction(callback_func):
+            # TODO: For sync callbacks, use executor instead of trigger
+            logger.error("Sync callbacks not supported yet: %s", self.callback)

Review Comment:
   I want to provide the ability for the user to only have the callback present 
on the host where it will be run (ie the triggerer or executor). In that use 
case, it would not be possible to detect at parse time. Because of this (among 
a couple of other reasons), we decided to change the DeadlineAlert SDK 
definition so that the user would need to specify what kind of callback it is



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