Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add callback_execution_timeout config for deadline callbacks#66609

Draft
seanghaeli wants to merge 2 commits intoapache:mainapache/airflow:mainfrom
aws-mwaa:ghaeli/callback-timeout-configaws-mwaa/upstream-to-airflow:ghaeli/callback-timeout-configCopy head branch name to clipboard
Draft

Add callback_execution_timeout config for deadline callbacks#66609
seanghaeli wants to merge 2 commits intoapache:mainapache/airflow:mainfrom
aws-mwaa:ghaeli/callback-timeout-configaws-mwaa/upstream-to-airflow:ghaeli/callback-timeout-configCopy head branch name to clipboard

Conversation

@seanghaeli
Copy link
Copy Markdown
Contributor

@seanghaeli seanghaeli commented May 8, 2026

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

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.6)

Generated-by: Claude Code (Opus 4.6) following the guidelines

Deadline callbacks currently have no timeout -- if a callback hangs, it
blocks the executor/triggerer indefinitely. This adds a single
[deadlines] callback_execution_timeout configuration option (default
300s) that enforces a maximum execution time for callback subprocesses.

When the timeout is exceeded, the supervisor kills the subprocess with
SIGTERM (escalating to SIGKILL if necessary). Setting the value to 0
disables the timeout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.