-
Notifications
You must be signed in to change notification settings - Fork 926
Upgrade tonic dependencies to 0.13.0 version #7377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thank you @rmn-boiko -- looks like there are a few CI failures yet to fix, but otherwise 💯 |
Have to hold this PR until prost will support latest tonic version |
047326a
to
5b6c22d
Compare
I've updated PR with the latest codegen changes. Will wait for comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rmn-boiko -- this looks good to me. It would be great to add a short doc string about the new router
feature though
@@ -46,7 +46,7 @@ that demonstrate how to build a Flight server implemented with [tonic](https://d | |||
- `flight-sql-experimental`: Enables experimental support for | |||
[Apache Arrow FlightSQL], a protocol for interacting with SQL databases. | |||
|
|||
- `tls`: Enables `tls` on `tonic` | |||
- `tls`: Enables `_tls-any` on `tonic` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please also add dos about the "router" feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in previous comments, we should encourage users to enable correct tonic's feature instead.
Or we can re-export the same feature flags.
Since this updates a dependency we need to wait for the next major arrow release before merging it |
@@ -917,6 +917,9 @@ mod tests { | |||
|
|||
let svc = FlightServiceServer::new(FlightSqlServiceImpl {}); | |||
|
|||
// Set dafault crypto provider to use | |||
// See: https://docs.rs/rustls/latest/rustls/crypto/struct.CryptoProvider.html#using-the-per-process-default-cryptoprovider | |||
rustls::crypto::ring::default_provider(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you need to call
let _ = rustls::crypto::ring::default_provider().install_default();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained in previous comments.
@@ -62,7 +62,8 @@ all-features = true | |||
[features] | |||
default = [] | |||
flight-sql-experimental = ["dep:arrow-arith", "dep:arrow-data", "dep:arrow-ord", "dep:arrow-row", "dep:arrow-select", "dep:arrow-string", "dep:once_cell", "dep:paste"] | |||
tls = ["tonic/tls"] | |||
tls = ["tonic/_tls-any"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can simply remove this feature and let users enable it directly on tonic
. Since it doesn't work even when users enable this feature, they still need to enable ring
or aws-lc
directly on tonic
anyway.
We should document this behavior change.
@@ -73,6 +74,7 @@ http = "1.1.0" | |||
http-body = "1.0.0" | |||
hyper-util = "0.1" | |||
pin-project-lite = "0.2" | |||
rustls = { version = "0.23", default-features = false, features = ["ring"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should enable it using tonic = { .., features = ["transport", "codegen", "prost", "tls-ring"]}
instead of relying directly on rustls.
Tricks happened at
https://docs.rs/tonic/latest/src/tonic/transport/channel/service/tls.rs.html#48-57
#[allow(unreachable_patterns)]
let builder = match crypto::CryptoProvider::get_default() {
Some(provider) => with_provider(provider.clone()),
#[cfg(feature = "tls-ring")]
None => with_provider(Arc::new(crypto::ring::default_provider())),
#[cfg(feature = "tls-aws-lc")]
None => with_provider(Arc::new(crypto::aws_lc_rs::default_provider())),
// somehow tls is enabled, but neither of the crypto features are enabled.
_ => ClientConfig::builder(),
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really have any knowledge / preference -- but it would be nice to get this PR ready to merge
@MichaelScofield has a slightly different proposal here:
@@ -46,7 +46,7 @@ that demonstrate how to build a Flight server implemented with [tonic](https://d | |||
- `flight-sql-experimental`: Enables experimental support for | |||
[Apache Arrow FlightSQL], a protocol for interacting with SQL databases. | |||
|
|||
- `tls`: Enables `tls` on `tonic` | |||
- `tls`: Enables `_tls-any` on `tonic` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in previous comments, we should encourage users to enable correct tonic's feature instead.
Or we can re-export the same feature flags.
@@ -917,6 +917,9 @@ mod tests { | |||
|
|||
let svc = FlightServiceServer::new(FlightSqlServiceImpl {}); | |||
|
|||
// Set dafault crypto provider to use | |||
// See: https://docs.rs/rustls/latest/rustls/crypto/struct.CryptoProvider.html#using-the-per-process-default-cryptoprovider | |||
rustls::crypto::ring::default_provider(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained in previous comments.
Which issue does this PR close?
Upgrade version of tonic used in dependencies from 0.12.3 to 0.13.0, which includes a batch of breaking changes.
Rationale for this change
Using the latest version of crates will prevent any potential issues and vulnerabilities. And will allow users to use latest tonic with arrow crates without keeping different versions
What changes are included in this PR?
Updated the new interface names.
Changed feature names used in the latest tonic.
Updated GitHub workflows to run tests correctly with the required tonic features.