Repository navigation
Run task callbacks in fresh interpreters - #73380
Open
keith991001 wants to merge 2 commits into
Open
keith991001 wants to merge 2 commits into
keith991001 wants to merge 2 commits into
Conversation
keith991001
requested review from
amoghrajesh,
ashb and
kaxil
as code owners
September 19, 2026 15:32
keith991001
force-pushed
the
codex/callback-subprocess-exec
branch
from
September 25, 2026 07:03
775afe1 to
829870b
Compare
Contributor
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
keith991001
force-pushed
the
codex/callback-subprocess-exec
branch
from
November 11, 2026 08:43
829870b to
c5b7407
Compare
Contributor
Author
|
Rebased on current main and pushed c5b7407. The startup protocol preserves the upstream callback kwargs encoding and XCom context support, and task-runner preloading remains limited to bare-fork mode. Ruff and diff checks pass. This PR is still active; the current Tests (AMD) run and CodeQL require maintainer approval. Linux runtime checks and the before/after performance benchmark are still pending. Drafted-by: Codex (GPT-6); reviewed by @keith991001 before posting |
Callback processes could inherit locks held by supervisor threads because their closure-based target required a bare fork. On current main, fresh interpreters start through the shared posix_spawn path, so the conflict resolution keeps that mechanism and gives callbacks an importable child entry point. Test Plan: ``` uv run --project task-sdk pytest task-sdk/tests/task_sdk/execution_time/test_callback_supervisor.py -xvs uv run --project task-sdk pytest task-sdk/tests/task_sdk/execution_time/test_callback_supervisor.py::test_callback_fresh_interpreter_end_to_end -xvs uv run --no-sync ruff check --fix task-sdk/src/airflow/sdk/execution_time/supervisor.py task-sdk/src/airflow/sdk/execution_time/callback_supervisor.py task-sdk/tests/task_sdk/execution_time/exec_probe_target.py task-sdk/tests/task_sdk/execution_time/test_callback_supervisor.py ``` Authored with assistance from Codex.
keith991001
force-pushed
the
codex/callback-subprocess-exec
branch
from
November 27, 2026 05:21
c5b7407 to
a63aee5
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Callbacks previously used a closure as their subprocess target, which prevented them from using the fresh-interpreter path and left them exposed to locks inherited from supervisor threads.
This change adds an importable callback child entry point, sends its startup data over the existing supervisor socket, and applies
execute_tasks_new_python_interpreterto callback subprocesses. It includes focused tests, a real fork+exec regression test, configuration documentation, and a significant newsfragment.Rebased on current main on 2026-11-11. The callback startup message preserves upstream callback-kwargs encoding and XCom context support. Bare-fork mode retains task-runner preloading; exec mode skips that preload.
Current validation: Ruff formatting/lint and
git diff --checkpass. Linux callback execution, task-sdk typing, and full pre-commit checks are delegated to GitHub CI because this checkout is on Windows without Breeze/Docker. The current Tests (AMD) and CodeQL runs require maintainer approval. A Linux before/after performance benchmark remains outstanding.closes: #73143
Was generative AI tooling used to co-author this PR?
Generated-by: Codex (GPT-6) following the guidelines
Drafted-by: Codex (GPT-6); reviewed by @keith991001 before posting