Skip to content

Java SDK: Reject byte arrays instead of hanging or failing silently - #74218

Merged
jason810496 merged 1 commit into
apache:mainfrom
FrankYang0529:airflow-java-sdk-reject-byte-array
Oct 15, 2026
Merged

jason810496 merged 1 commit into
apache:mainfrom
FrankYang0529:airflow-java-sdk-reject-byte-array

Conversation

@FrankYang0529

@FrankYang0529 FrankYang0529 commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Why

  • A Java task that pushes a byte[], for example with client.setXCom("payload", bytes) or client.getTaskStateStore().set("key", bytes), doesn't return an error that explains the problem. What happens depends on the values of the bytes:
    • If no byte is between 0x80 and 0xDF, the supervisor rejects the byte array because the supervisor only accepts JSON values. The supervisor logs Unable to decode message and doesn't reply, so the task doesn't finish on its own.
    • If any byte is between 0x80 and 0xDF, the frame is corrupted. The packByteArray wrote each byte with packByte, which encodes a byte in that range as two bytes, but the bin header still declares the original array length. The supervisor of the task stops with an exception while decoding the frame, and the task fails with nothing in the task log.

How

  • packAny throws IllegalArgumentException for a ByteArray, including a ByteArray nested in a map or list, before anything is written to the socket. The exception message asks the task author to encode the bytes as a string.

Was generative AI tooling used to co-author this PR?
  • Yes - Claude Code

@FrankYang0529 FrankYang0529 changed the title Java SDK: Reject byte arrays instead of letting the task hang Clear language SDK task XComs in the coordinator when a try starts Oct 14, 2026
@FrankYang0529 FrankYang0529 changed the title Clear language SDK task XComs in the coordinator when a try starts Java SDK: Reject byte arrays instead of letting the task hang Oct 14, 2026
Signed-off-by: PoAn Yang <payang@apache.org>
@FrankYang0529
FrankYang0529 force-pushed the airflow-java-sdk-reject-byte-array branch from d6a58ff to 7570af2 Compare October 15, 2026 06:17
@FrankYang0529 FrankYang0529 changed the title Java SDK: Reject byte arrays instead of letting the task hang Java SDK: Reject byte arrays instead of hanging or failing silently Oct 15, 2026

@jason810496 jason810496 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.

Nice, thanks for the improvement.

@jason810496
jason810496 marked this pull request as ready for review October 15, 2026 23:07
@jason810496
jason810496 requested a review from uranusjr as a code owner October 15, 2026 23:07
@jason810496
jason810496 merged commit 665b949 into apache:main Oct 15, 2026
93 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

@FrankYang0529
FrankYang0529 deleted the airflow-java-sdk-reject-byte-array branch October 15, 2026 23:32
vatsrahul1001 pushed a commit that referenced this pull request Oct 18, 2026
…hang (#74218) (#74831)

(cherry picked from commit 665b949)

Signed-off-by: PoAn Yang <payang@apache.org>
Co-authored-by: PoAn Yang <payang@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants