Restore mp_start_method config and add mp_forkserver_preload config#68875
Merged
vatsrahul1001 merged 3 commits intoJun 23, 2026
Merged
Conversation
ashb
reviewed
Jun 23, 2026
ashb
approved these changes
Jun 23, 2026
jason810496
commented
Jun 23, 2026
jason810496
left a comment
Member
Author
There was a problem hiding this comment.
Found the typo in the last sec, I should use claude to remove the API section out (I did it manually) then.
amoghrajesh
reviewed
Jun 23, 2026
amoghrajesh
left a comment
Contributor
There was a problem hiding this comment.
The PR description mentions [api] as a configurable component but I dont seem to find it there? Either wire it up or drop [api] from the description and config docs.
aaa07b4 to
9403aa4
Compare
vatsrahul1001
approved these changes
Jun 23, 2026
cetingokhan
pushed a commit
to cetingokhan/airflow
that referenced
this pull request
Jun 24, 2026
…pache#68875) * Restore mp_start_method config and add mp_forkserver_preload config * Remove set_component_mp_start_method for API server * Spec multiprocessing mocks and cover start-method failure path
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.
Why
Python 3.14 changed the Unix (non-macOS) default
multiprocessingstart method fromforktoforkserver(python/cpython#84559).forkserver/spawnchildren re-import Airflow instead of sharing it copy-on-write, so the scheduler'sLocalExecutorworkers and the triggerer each pay for a private copy.forkdefault) to 3.3.0b1 / Python 3.14.6 (forkserverdefault) measured steady-state PSS (Proportional Set Size, the copy-on-write-aware resident memory metric) up +96% for the scheduler and +90% for the triggerer; settingmp_start_method = forkfor the scheduler and triggerer on the new stack brings them back to +17% / +20% of that baseline.This restores control over the start method so deployments can recover the pre-3.14 footprint. It is opt-in: unset keeps the platform default, so there is no behaviour change unless configured.
What
[core] mp_start_method(overridable per component via[scheduler],[triggerer]or[dag_processor]) and[core] mp_forkserver_preload.resolve_mp_start_method/set_component_mp_start_methodtoprocess_utils; the latter applies the configured method and forkserver preload modules, and is a safe no-op when unset or when the method is unavailable on the platform.set_component_mp_start_methodfrom the scheduler, triggerer and dag-processor CLI entrypoints, before anymultiprocessingwork.LocalExecutor.is_mp_using_forkper instance instead of once at import, so it honours a start method set by the CLI before the executor is created.Note:
[core] mp_start_methodexisted historically but was removed (functional part in #48817, config remnants in #61150) and only ever governed the pre-3.0 Dag-processing manager, neverLocalExecutor. The version restored here is wired into the executor and component start paths so it actually controls the workers.Scheduler / triggerer memory benchmark — patch-mode summary
Modes: baseline (no patch) | gc (periodic gc.collect) | fspreload (forkserver + set_forkserver_preload) | fork (set_start_method fork) | gc_fspreload / gc_fork (combinations) | forkserver (forkserver, no preload).
Permutation setup & effective start method
Reference baseline (Δ denominator): 3.2.2 / py3.13.14 (baseline).
airflow,airflow.models,airflow.executors.local_executor,airflow.sdk,sqlalchemy,pydanticSteady-state PSS (MB), Δ vs the reference baseline
Per-stack mitigation (Δ vs each stack's own baseline)
The headline table above is vs the pre-regression reference. These pivots instead show each patch mode vs that same stack's baseline column, i.e. the mitigation effect on the PR stack itself (fork/fspreload/forkserver vs the unset run on 3.3.0b1/3.14.6).
How to read this
Was generative AI tooling used to co-author this PR?