hussein-awala commented on code in PR #33718:
URL: https://github.com/apache/airflow/pull/33718#discussion_r1306049772
##########
airflow/sensors/base.py:
##########
@@ -285,6 +286,8 @@ def run_duration() -> float:
def resume_execution(self, next_method: str, next_kwargs: dict[str, Any] |
None, context: Context):
try:
return super().resume_execution(next_method, next_kwargs, context)
+ except TaskDeferralTimeout as e:
+ raise AirflowSensorTimeout(*e.args) from e
Review Comment:
With this change, you stop the sensor execution when timeout is reached
regardless its reason. Is it expected? Because if so, sync and async sensor
will be inconsistent.
##########
airflow/sensors/time_delta.py:
##########
@@ -64,7 +64,11 @@ class TimeDeltaSensorAsync(TimeDeltaSensor):
def execute(self, context: Context):
target_dttm = context["data_interval_end"]
target_dttm += self.delta
- self.defer(trigger=DateTimeTrigger(moment=target_dttm),
method_name="execute_complete")
+ self.defer(
+ trigger=DateTimeTrigger(moment=target_dttm),
+ method_name="execute_complete",
+ timeout=self.timeout,
Review Comment:
I think in this case, we'll need to explicitly add
`timeout=min(self.timeout, custom_timeout)` in all the sensors? (just
self.timeout if we don't want to add a custom timeout for the trigger)
--
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]