Repository navigation
feat(flight): add gRPC reflection support - #12279
Conversation
46ef1b2 to
51154e7
Compare
|
Hi @alamb , this PR is ready for review now. Could you take a look when you have time? Thanks |
01fc604 to
09ca806
Compare
alamb
left a comment
There was a problem hiding this comment.
Thanks @Phoenix500526 -- the basic idea looks good to me. I think we should:
- Make this feature optional (as in make an optional reflection in arrow-flight) so people dont' get the new dependency unless they want it
- Document the feature flag and add a note to the main flight lib.rs / readme about supporting reflection and how to enable it
| 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"] } |
There was a problem hiding this comment.
I followed the existing exact pins for tonic and tonic-prost in this crate. It's updated now.
09ca806 to
76be945
Compare
Good call. Done. |
alamb
left a comment
There was a problem hiding this comment.
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
76be945 to
f054574
Compare
|
Thanks again @Phoenix500526 |
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-reflectionis a development dependency.Are these changes tested?
The new
test_reflectionruns over Unix sockets, HTTP, and mutual TLS. It checks service discovery, reflected message definitions and imported descriptors, and a successfulListActionscall. Removing reflection registration makes the test fail. The existing Flight tests and example tests also pass, and reflection was verified manually withgrpcurlwithout 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.
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.