fix(task-sdk): set default Content-Type header on execution API client - #63215
Closed
YoannAbriel wants to merge 1 commit into
Closed
fix(task-sdk): set default Content-Type header on execution API client#63215YoannAbriel wants to merge 1 commit into
YoannAbriel wants to merge 1 commit into
Conversation
YoannAbriel
force-pushed
the
fix/issue-63209
branch
5 times, most recently
from
March 14, 2026 13:07
9261699 to
adb01e2
Compare
YoannAbriel
force-pushed
the
fix/issue-63209
branch
2 times, most recently
from
March 23, 2026 13:09
e5f4abd to
04352bf
Compare
YoannAbriel
force-pushed
the
fix/issue-63209
branch
from
March 23, 2026 19:07
04352bf to
6f70d36
Compare
YoannAbriel
force-pushed
the
fix/issue-63209
branch
from
April 5, 2026 09:01
6f70d36 to
1c59403
Compare
YoannAbriel
force-pushed
the
fix/issue-63209
branch
9 times, most recently
from
April 10, 2026 09:04
995578e to
d980eca
Compare
YoannAbriel
force-pushed
the
fix/issue-63209
branch
3 times, most recently
from
April 13, 2026 06:06
c1b3043 to
2a1da0e
Compare
The task SDK client sends JSON payloads via httpx's content= parameter, which doesn't set Content-Type automatically. Without it, the API server can't parse the body and returns 422, causing the supervisor to SIGKILL the task subprocess. Add 'content-type: application/json' to the default client headers so all requests are properly identified as JSON. Closes: apache#63209
YoannAbriel
force-pushed
the
fix/issue-63209
branch
from
April 13, 2026 15:05
2a1da0e to
904604d
Compare
amoghrajesh
requested changes
Apr 14, 2026
Contributor
|
Closing the PR with above comment. |
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.
Problem
Task subprocesses get killed with SIGKILL immediately after starting. The API server returns 422 on
PATCH /execution/task-instances/{id}/runbecause the request body is received as a raw string instead of parsed JSON.Root Cause
client.pyuses httpx'scontent=body.model_dump_json()to send requests. Thecontent=parameter sets the raw body but does not set aContent-Typeheader — so the API server (cadwyn/FastAPI) can't identify the payload as JSON, passes it to Pydantic as a plain string, and rejects it with amodel_attributes_typevalidation error.Fix
Added
content-type: application/jsonto the default headers inClient.__init__(). This covers all call sites that usecontent=(start, heartbeat, state transitions, etc.) without touching each one individually.Added a test that verifies the header is present on outgoing requests.
Closes: #63209
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.