Repository navigation
Conversation
Transport compact JSON through task startup and decode it once in the task process. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 task done
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.
Summary
Avoid materializing large
DagRun.confobject graphs in the Execution APIserver and task supervisor.
The task-start endpoint now:
DagRun.confattribute;CAST(dag_run.conf AS TEXT)once;TIRunContext.dag_run_conf_jsonfield;TIRunContext.dag_run.confasNone;context construction.
The decoded dictionary is cached on
dag_run.conf, and the serialized stringis released, so repeated
get_template_context()calls do not parse it again.Related: #74025
Scope
This intentionally addresses only task-start memory amplification:
It replaces the memory portion of closed draft #74182 following review feedback
that the earlier PR mixed persistence correctness and transport optimization.
Difference from #74048
#74048 first materialized
DagRun.confin the Execution API and supervisor,then serialized it back to JSON before sending it to the task.
This change selects serialized text directly from the database. The API server
and supervisor never construct the nested dictionary. The task still
materializes it once because existing params, templates, and DAG code require
dictionary behavior.
Compatibility
DagRunAPI responses keep the existing dictionary schema.TIRunContextgains the optionaldag_run_conf_jsonfield.not receive the new field.
NULLconfiguration remainsNone.{}configuration is preserved and decoded once.Evidence
Synthetic isolated-phase benchmark with an 11,461,903-byte nested payload:
The task-side cost remains. This draft still needs concurrent end-to-end pod RSS
and startup-latency evidence before it is ready.
Validation
Passed in Apache's Linux CI image:
NULLconf regression;git diff --check.The query uses
selectinloadfor consumed asset events so the large JSON stringis not duplicated once per joined collection row.
Was generative AI tooling used to co-author this PR?
description drafting). The design and changes were reviewed and validated by
the contributor.