seanghaeli opened a new pull request, #66609:
URL: https://github.com/apache/airflow/pull/66609

   ## Summary
   
   Adds a `[deadlines] callback_execution_timeout` configuration option that 
sets a maximum execution time for deadline callbacks. If a callback exceeds 
this timeout, the supervisor kills it with SIGTERM (escalating to SIGKILL).
   
   Default: 300 seconds (5 minutes). Set to 0 to disable.
   
   ## Discussion — seeking community input
   
   This PR is intentionally opened as a draft to invite discussion on the 
design:
   
   1. **Single global config vs per-callback?** Currently a single `[deadlines] 
callback_execution_timeout` applies to all callbacks. Should users be able to 
override per-callback (e.g., via a kwarg on the deadline definition)?
   
   2. **Default value?** 300s (5 min) seems reasonable for alert callbacks 
(send a Slack message, trigger a PagerDuty alert). Too short for heavy 
callbacks? Too long for simple ones?
   
   3. **Sync + async?** Should this apply to both executor (sync) and triggerer 
(async) callback paths, or just one?
   
   4. **Config section?** Using `[deadlines]` since this is specific to 
deadline callbacks. Alternative: `[callbacks]` if we want it to apply to all 
future callback types (dag/task callbacks when migrated).
   
   ## Changes
   
   - `config.yml`: New `[deadlines]` section with `callback_execution_timeout` 
(integer, default 300, version_added 3.3.0)
   - `callback_supervisor.py`: Timeout enforcement in `_monitor_subprocess()` 
using `time.monotonic()`, kills via existing `kill()` method
   - Tests: timeout kill + disabled (timeout=0) behavior
   
   ## Related
   
   - Part of AIP-86 (Deadline Alerts) scope for 3.3.0
   - Asana task: "Callback timeout — Small discussion/decision ticket"
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.6)
   
   Generated-by: Claude Code (Opus 4.6) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


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