-
Notifications
You must be signed in to change notification settings - Fork 927
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,11 +44,11 @@ bytes = { version = "1", default-features = false } | |
futures = { version = "0.3", default-features = false, features = ["alloc"] } | ||
once_cell = { version = "1", optional = true } | ||
paste = { version = "1.0" , optional = true } | ||
prost = { version = "0.13.1", default-features = false, features = ["prost-derive"] } | ||
prost = { version = "0.13.5", default-features = false, features = ["prost-derive"] } | ||
# For Timestamp type | ||
prost-types = { version = "0.13.1", default-features = false } | ||
prost-types = { version = "0.13.5", default-features = false } | ||
tokio = { version = "1.0", default-features = false, features = ["macros", "rt", "rt-multi-thread"], optional = true } | ||
tonic = { version = "0.12.3", default-features = false, features = ["transport", "codegen", "prost"] } | ||
tonic = { version = "0.13.0", default-features = false, features = ["transport", "codegen", "prost"] } | ||
|
||
# CLI-related dependencies | ||
anyhow = { version = "1.0", optional = true } | ||
|
@@ -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"] | ||
router = ["tonic/router"] | ||
# Enable CLI tools | ||
cli = ["arrow-array/chrono-tz", "arrow-cast/prettyprint", "tonic/tls-webpki-roots", "dep:anyhow", "dep:clap", "dep:tracing-log", "dep:tracing-subscriber"] | ||
|
||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. We should enable it using 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 commentThe 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: |
||
tempfile = "3.3" | ||
tracing-log = { version = "0.2" } | ||
tracing-subscriber = { version = "0.3.1", default-features = false, features = ["ansi", "env-filter", "fmt"] } | ||
|
@@ -83,7 +85,7 @@ uuid = { version = "1.10.0", features = ["v4"] } | |
|
||
[[example]] | ||
name = "flight_sql_server" | ||
required-features = ["flight-sql-experimental", "tls"] | ||
required-features = ["flight-sql-experimental", "tls", "router"] | ||
|
||
[[bin]] | ||
name = "flight_sql_client" | ||
|
@@ -92,9 +94,9 @@ required-features = ["cli", "flight-sql-experimental", "tls"] | |
[[test]] | ||
name = "flight_sql_client" | ||
path = "tests/flight_sql_client.rs" | ||
required-features = ["flight-sql-experimental", "tls"] | ||
required-features = ["flight-sql-experimental", "tls", "router"] | ||
|
||
[[test]] | ||
name = "flight_sql_client_cli" | ||
path = "tests/flight_sql_client_cli.rs" | ||
required-features = ["cli", "flight-sql-experimental", "tls"] | ||
required-features = ["cli", "flight-sql-experimental", "tls", "router"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe 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. |
||
|
||
## CLI | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -813,7 +813,7 @@ mod tests { | |
async fn bind_tcp() -> (TcpIncoming, SocketAddr) { | ||
let listener = TcpListener::bind("0.0.0.0:0").await.unwrap(); | ||
let addr = listener.local_addr().unwrap(); | ||
let incoming = TcpIncoming::from_listener(listener, true, None).unwrap(); | ||
let incoming = TcpIncoming::from(listener); | ||
(incoming, addr) | ||
} | ||
|
||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. maybe you need to call
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As explained in previous comments. |
||
let serve_future = Server::builder() | ||
.tls_config(tls_config) | ||
.unwrap() | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 enablering
oraws-lc
directly ontonic
anyway.We should document this behavior change.