jason810496 commented on code in PR #74869:
URL: https://github.com/apache/airflow/pull/74869#discussion_r4313205172


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -409,6 +410,9 @@ def ti_run(
                     },
                 )
 
+        if (execution_timeout := get_execution_timeout(dag_bag, ti, 
session=session)) is not None:

Review Comment:
   nit: Let's retrieve the `SerializedOperator` via `get_task` and pass it down 
to arg_bindings and execution_timeout to avoid the duplicated prob overhead.



##########
airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py:
##########
@@ -512,6 +512,13 @@ class TIRunContext(BaseModel):
     ``None`` for regular tasks and for stub tasks that declare no parameters.
     """
 
+    execution_timeout: float | None = None

Review Comment:
   IIUC, we need to fill the task level execution_timeout at 
`DagSerialization.fill_config_defaults`.
   We can keep `execution_timeout` for now and follow-up for rest of the 
task-level default arguments.



##########
task-sdk/src/airflow/sdk/execution_time/supervisor.py:
##########
@@ -1726,6 +1726,7 @@ def _on_child_started(
             # tell us "no, stop!" for any reason)
             ti_context = self.client.task_instances.start(ti.id, self.pid, 
datetime.now(tz=UTC))
             self._should_retry = ti_context.should_retry
+            self._execution_timeout_seconds = ti_context.execution_timeout

Review Comment:
   IIUC, we don't need to set the `_execution_timeout_seconds` here. Let's keep 
the `_arm_execution_timeout` as single writer to mutate the attribute state.



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