Skip to content

feat(flight): add gRPC reflection support - #12279

Merged
alamb merged 4 commits into
apache:mainfrom
Phoenix500526:issue/1706
Dec 2, 2026
Merged

alamb merged 4 commits into
apache:mainfrom
Phoenix500526:issue/1706

Conversation

@Phoenix500526

@Phoenix500526 Phoenix500526 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Downstream Flight servers need the protocol descriptors to expose their APIs through gRPC reflection without regenerating the protobuf definitions themselves.

What changes are included in this PR?

Generate and vendor the Flight descriptor set, including its Timestamp dependency, and expose it as arrow_flight::FILE_DESCRIPTOR_SET. Enable reflection v1 in the Flight SQL server example, with a private service-registration helper shared by the example and its tests. tonic-reflection is a development dependency.

Are these changes tested?

The new test_reflection runs over Unix sockets, HTTP, and mutual TLS. It checks service discovery, reflected message definitions and imported descriptors, and a successful ListActions call. Removing reflection registration makes the test fail. The existing Flight tests and example tests also pass, and reflection was verified manually with grpcurl without local proto files.

Descriptor source metadata is stripped after Rust code generation to avoid differences in installed protobuf comments and source locations, while preserving generated Rust documentation. The reflection test checks that this metadata is absent. Local protoc 3.20.3, 3.21.1, and 29.3 installations produce identical descriptors. The binary descriptor is excluded from source-header checks.

image

Are there any significant user-facing changes?

No breaking API changes. Enabling reflection remains opt-in for downstream servers.

AI usage disclosure

Codex assisted with the implementation, regression test, validation, and code review.

@boring-cyborg boring-cyborg Bot added the arrow-flight arrow-flight crate label Nov 16, 2026
@Phoenix500526
Phoenix500526 marked this pull request as ready for review November 25, 2026 08:36
@Phoenix500526

Copy link
Copy Markdown
Contributor Author

Hi @alamb , this PR is ready for review now. Could you take a look when you have time? Thanks

@Phoenix500526
Phoenix500526 force-pushed the issue/1706 branch 2 times, most recently from 01fc604 to 09ca806 Compare November 28, 2026 05:37

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @Phoenix500526 -- the basic idea looks good to me. I think we should:

  1. Make this feature optional (as in make an optional reflection in arrow-flight) so people dont' get the new dependency unless they want it
  2. Document the feature flag and add a note to the main flight lib.rs / readme about supporting reflection and how to enable it

Comment thread arrow-flight/Cargo.toml Outdated
tempfile = "3.3"
tokio = { version = "1.0", default-features = false, features = ["macros", "rt", "rt-multi-thread"] }
tokio-stream = { version = "0.1", features = ["net"] }
tonic-reflection = { version = "=0.14.9", default-features = false, features = ["server"] }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why the exact pin?

@Phoenix500526 Phoenix500526 Nov 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I followed the existing exact pins for tonic and tonic-prost in this crate. It's updated now.

@boring-cyborg boring-cyborg Bot added the development-process Internal changes; PRs with this label are excluded from changelog label Nov 30, 2026
@Phoenix500526

Copy link
Copy Markdown
Contributor Author

Thanks @Phoenix500526 -- the basic idea looks good to me. I think we should:

  1. Make this feature optional (as in make an optional reflection in arrow-flight) so people dont' get the new dependency unless they want it
  2. Document the feature flag and add a note to the main flight lib.rs / readme about supporting reflection and how to enable it

Good call. Done.

@Phoenix500526
Phoenix500526 requested a review from alamb November 30, 2026 16:23

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @Phoenix500526 -- this makes sense to me

I didn't realize the tonic-reflection dep was optional -- the way you had it would be fine too but this way looks good as well

I had a few minor comments, but otherwise this looks great

Thank you

Comment thread arrow-flight/README.md Resolved
Comment thread arrow-flight/src/lib.rs Resolved
@Phoenix500526

Copy link
Copy Markdown
Contributor Author

Thanks @Phoenix500526 -- this makes sense to me

I didn't realize the tonic-reflection dep was optional -- the way you had it would be fine too but this way looks good as well

I had a few minor comments, but otherwise this looks great

Thank you

Thanks @alamb for your review. All comments have been resolved. 😄

Expose Flight descriptors so downstream servers can enable
reflection without regenerating protocol definitions.

CLOSES apache#1706
Source metadata differs across protobuf installations and makes
the vendored-code check fail. Strip it after generating Rust docs
and exclude the binary descriptor from source-header checks.

Refs apache#1706
Keep reflection dependencies opt-in and document service registration.

Refs apache#1706
Show service registration with code instead of repeating its steps.

Refs apache#1706
@alamb
alamb added this pull request to the merge queue Dec 2, 2026
@alamb

alamb commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Thanks again @Phoenix500526

Merged via the queue into apache:main with commit ff671cc Dec 2, 2026
22 checks passed
@Phoenix500526
Phoenix500526 deleted the issue/1706 branch December 2, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow-flight arrow-flight crate development-process Internal changes; PRs with this label are excluded from changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add gRPC reflection support to arrow flight

2 participants