Skip to content

GH-448: Preserve error metadata when server middleware rejects calls - #1388

Merged
jbonofre merged 1 commit into
apache:mainfrom
hutiefang76:frank/arrow448-middleware-trailers-20261024
Nov 16, 2026
Merged

jbonofre merged 1 commit into
apache:mainfrom
hutiefang76:frank/arrow448-middleware-trailers-20261024

Conversation

@hutiefang76

@hutiefang76 hutiefang76 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What's Changed

When a server middleware factory rejects a call with a FlightRuntimeException, the interceptor closes the RPC with empty trailers. The client receives the status but loses any custom error metadata. Preserve those trailers through the existing Flight-to-gRPC exception conversion, without changing the status conversion or adding public API.

Add real client/server regressions for the status, description, ASCII and binary metadata, and rejection before the producer is invoked. A control covers rejection without custom metadata. The metadata regression fails on the unchanged implementation and passes with the fix.

Validation on JDK 21, with the repository-pinned testing submodule initialized:

  • mvn -B -ntp -Dmaven.gitcommitid.nativegit=true -pl flight/flight-core -am verify passed, including the dependency modules.
  • Flight Core: 27 test classes, 148 cases, 17 skipped, no failures or errors. All 10 middleware cases and all 4 TLS cases passed without skips.
  • Spotless and Checkstyle passed. The native Git option handles the existing Git plugin's local worktree compatibility; no build configuration was changed.

Closes #448.

Maintainer note: please add the bug-fix label; my account cannot add labels to this repository. The Test and Integration workflows currently show action_required; could you approve those runs when appropriate? Remote CI and maintainer review remain pending.

AI-generated PR description. Investigation, implementation and automated review assisted by Codex and DeepSeek.

@jbonofre jbonofre added the bug-fix PRs that fix a big. label Nov 15, 2026
@apache apache deleted a comment from github-actions Bot Nov 15, 2026
@github-actions github-actions Bot added this to the 20.0.0 milestone Nov 15, 2026

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

LGTM, thanks @hutiefang76 for the fix and test coverage.

…calls

Forward exception trailers through the existing Flight-to-gRPC conversion
so middleware rejection preserves custom text and binary error metadata.
Verify the real client/server path and a rejection without custom metadata.

Generated-by: Codex and DeepSeek
@jbonofre
jbonofre force-pushed the frank/arrow448-middleware-trailers-20261024 branch from 5a802b0 to ca84d17 Compare November 16, 2026 15:23
@jbonofre
jbonofre merged commit c0fb78e into apache:main Nov 16, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PRs that fix a big.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Java] User's Exception's metadata thrown by method FlightServerMiddleware.onCallStarted() getting override and set to empty value

2 participants