shivaam commented on PR #76103:
URL: https://github.com/apache/airflow/pull/76103#issuecomment-6561976619

   Thanks @ChickenBenny and @jason810496, agreed. I'll rebase once #75387 
merges and send `SetExecutionTimeout(timeout_seconds)` right before the task's 
work starts.
   
   On the 30 s wait: agreed, we can use `killed_task_cleanup_time` once the 
coordinator passes it to the runtime. Here is how the two clocks line up for a 
task with `execution_timeout` = 39 s and the default `killed_task_cleanup_time` 
= 60 s:
   
   ```
                 T           T+39                        T+99                   
T+159
                 
|-----------|---------------------------|-----------------------|
   TS runtime    task runs   timeout: abort signal,      report "Task timed out
                             wait for cleanup            after 39 seconds", exit
   
   supervisor    counting ...                            SIGTERM              
SIGKILL
                                                         (each only if the 
process is still alive)
   ```
   
   - At the timeout the runtime aborts the task's signal with 
`TaskTimeoutError` and waits for it to clean up.
   - With the config value, that wait ends at T+99, the same moment the 
supervisor sends SIGTERM. Whichever comes first, the runtime reports the 
timeout and exits.
   - SIGKILL 60 s later only matters for a process that cannot stop itself, 
such as a synchronous loop.
   - Today the runtime waits a fixed 30 s (the same wait it gives after 
SIGTERM), so it reports at T+69. If `killed_task_cleanup_time` is under 30 s, 
the supervisor's SIGTERM arrives first and the runtime stops waiting then.
   
   ---
   Drafted-by: Claude Code (Opus 5.5); reviewed by @shivaam before posting
   


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