Skip to content

[v3-3-test] Fix short-read handling in task-sdk IPC framing (#69253) - #71609

Merged
potiuk merged 1 commit into
v3-3-testfrom
backport-f72e6c9-v3-3-test
Aug 17, 2026
Merged

potiuk merged 1 commit into
v3-3-testfrom
backport-f72e6c9-v3-3-test

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Stream sockets are not required to return the full requested count from
recv(), but the 4-byte length prefix on the supervisor↔subprocess socket
was read with a single sock.recv(4). On a short read, the parsed length
is garbage, which either raises msgspec.DecodeError in the subprocess or
silently deadlocks the supervisor's selector reader (length_needed=0
makes the falsy payload check skip forever, so no frame is ever
dispatched to handle_requests).

Accumulate the header bytes on both sides, mirroring the payload
accumulation that was already correct. Add regression tests using a
socket that returns 2 bytes at a time to reliably reproduce the short
read.
(cherry picked from commit f72e6c9)

Co-authored-by: Andrew Chang [email protected]

Stream sockets are not required to return the full requested count from
recv(), but the 4-byte length prefix on the supervisor↔subprocess socket
was read with a single sock.recv(4). On a short read, the parsed length
is garbage, which either raises msgspec.DecodeError in the subprocess or
silently deadlocks the supervisor's selector reader (length_needed=0
makes the falsy payload check skip forever, so no frame is ever
dispatched to handle_requests).

Accumulate the header bytes on both sides, mirroring the payload
accumulation that was already correct. Add regression tests using a
socket that returns 2 bytes at a time to reliably reproduce the short
read.
(cherry picked from commit f72e6c9)

Co-authored-by: Andrew Chang <[email protected]>
@potiuk
potiuk marked this pull request as ready for review August 17, 2026 12:32
@potiuk
potiuk force-pushed the backport-f72e6c9-v3-3-test branch from c66e512 to 33b7e46 Compare August 17, 2026 12:32

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased onto the current v3-3-test tip; the backport replays cleanly and the tests and prek hooks it touches pass locally against this branch.

Scope-checked for a maintenance branch: this is a bugfix / documentation / dev-tooling change, with no new user-facing behaviour.


Drafted-by: Claude Code (Opus 5) (no human review before posting)

@potiuk
potiuk merged commit 0c8354c into v3-3-test Aug 17, 2026
90 of 91 checks passed
@potiuk
potiuk deleted the backport-f72e6c9-v3-3-test branch August 17, 2026 16:49
@github-actions github-actions Bot added this to the Airflow 3.3.2 milestone Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

Hi maintainer, this PR was merged without a milestone set.
We've automatically set the milestone to Airflow 3.3.2 based on: bug fix merged to version branch
If this milestone is not correct, please update it to the appropriate milestone.

This comment was generated by Milestone Tag Assistant.

vatsrahul1001 pushed a commit that referenced this pull request Sep 7, 2026
…71609)

Stream sockets are not required to return the full requested count from
recv(), but the 4-byte length prefix on the supervisor↔subprocess socket
was read with a single sock.recv(4). On a short read, the parsed length
is garbage, which either raises msgspec.DecodeError in the subprocess or
silently deadlocks the supervisor's selector reader (length_needed=0
makes the falsy payload check skip forever, so no frame is ever
dispatched to handle_requests).

Accumulate the header bytes on both sides, mirroring the payload
accumulation that was already correct. Add regression tests using a
socket that returns 2 bytes at a time to reliably reproduce the short
read.
(cherry picked from commit f72e6c9)

Co-authored-by: Andrew Chang <[email protected]>
@vatsrahul1001 vatsrahul1001 added the type:bug-fix Changelog: Bug Fixes label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:task-sdk type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants