ChickenBenny commented on code in PR #75387:
URL: https://github.com/apache/airflow/pull/75387#discussion_r4422742208
##########
task-sdk/src/airflow/sdk/execution_time/supervisor.py:
##########
@@ -2020,10 +2019,12 @@ def _handle_execution_timeout_if_needed(self):
can still run Python signal handlers; one that has not reported a
terminal state within the grace
period is stuck (native code, SIGSEGV) and is sent SIGTERM, then
SIGKILL.
- For a Python task, ``StartExecutionTimeout`` arms the deadline right
before ``execute()``, so bundle
- loading and Dag parsing are not covered; Dag parsing has its own
``dagbag_import_timeout``. For a
- task a language SDK runs, it is armed once the runtime has been sent
``StartupDetails``. Either
- way, the process is sent SIGTERM ``killed_task_cleanup_time`` after
the timeout elapses.
+ For a Python task, ``SetExecutionTimeout`` arms the deadline right
before ``execute()`` with the
+ timeout the task process enforces itself, so both use the same value;
bundle loading and Dag
+ parsing are not covered, as Dag parsing has its own
``dagbag_import_timeout``. For a task a language
+ SDK runs, it is armed with the run context's ``execution_timeout``
once the runtime has been sent
+ ``StartupDetails``. Either way, the process is sent SIGTERM
``killed_task_cleanup_time`` after the
+ timeout elapses.
Review Comment:
Fix with cb240d1a65
##########
airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py:
##########
@@ -558,10 +558,11 @@ class TIRunContext(BaseModel):
execution_timeout: float | None = None
"""
- The ``execution_timeout`` in seconds of a task a language SDK runs, from
its serialized Dag.
+ The ``execution_timeout`` in seconds set on a task a language SDK runs,
from its serialized Dag.
- The supervisor enforces the timeout with this value. A Python task runs
its own timer in the task
- runner instead, and gets no value here. ``None`` when no timeout is set.
+ Unset when the task sets none. Zero means no timeout and a negative value
has already elapsed, as
+ for a Python task. A Python task runs its own timer in the task runner
instead, and gets no value
+ here.
Review Comment:
Moved to Field(description=...) in cb240d1a65, so it now shows up in the
supervisor schema and the generated Go/TS/Python models.
--
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]