This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 7b7aad257a Upgrade tonic dependencies to 0.13.0 version (try 2) (#7839)
7b7aad257a is described below
commit 7b7aad257a2b774795eda7d2d19a684c0681f031
Author: Andrew Lamb <[email protected]>
AuthorDate: Wed Jul 16 13:38:37 2025 -0400
Upgrade tonic dependencies to 0.13.0 version (try 2) (#7839)
# Which issue does this PR close?
- Related to #7395
- Closes https://github.com/apache/arrow-rs/pull/7495
- Closes https://github.com/apache/arrow-rs/pull/7377
# Rationale for this change
Let's update tonic to the latest
Given the open and unresolved questions on @rmn-boiko's PR
https://github.com/apache/arrow-rs/pull/7377 from @Xuanwo and @sundy-li,
I thought a new PR would result in a faster resolution.
# What changes are included in this PR?
This PR is based on https://github.com/apache/arrow-rs/pull/7495 from
@MichaelScofield -- I resolved some merge conflicts and updated
Cargo.toml in the integration tests
# Are these changes tested?
Yes, by CI
# Are there any user-facing changes?
New dependency version
---------
Co-authored-by: LFC <[email protected]>
---
.github/workflows/arrow_flight.yml | 2 +-
arrow-flight/Cargo.toml | 18 +++++++++++-------
arrow-flight/README.md | 9 ++++++++-
arrow-flight/examples/flight_sql_server.rs | 2 +-
arrow-flight/gen/Cargo.toml | 2 +-
arrow-flight/src/arrow.flight.protocol.rs | 14 ++++++++------
arrow-integration-testing/Cargo.toml | 2 +-
7 files changed, 31 insertions(+), 18 deletions(-)
diff --git a/.github/workflows/arrow_flight.yml
b/.github/workflows/arrow_flight.yml
index 2659a0d987..a76d721b49 100644
--- a/.github/workflows/arrow_flight.yml
+++ b/.github/workflows/arrow_flight.yml
@@ -60,7 +60,7 @@ jobs:
cargo test -p arrow-flight --all-features
- name: Test --examples
run: |
- cargo test -p arrow-flight --features=flight-sql,tls --examples
+ cargo test -p arrow-flight --features=flight-sql,tls-ring --examples
vendor:
name: Verify Vendored Code
diff --git a/arrow-flight/Cargo.toml b/arrow-flight/Cargo.toml
index 041901e491..ca0d1c5e4b 100644
--- a/arrow-flight/Cargo.toml
+++ b/arrow-flight/Cargo.toml
@@ -48,7 +48,7 @@ prost = { version = "0.13.1", default-features = false,
features = ["prost-deriv
# For Timestamp type
prost-types = { version = "0.13.1", 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", default-features = false, features = ["transport",
"codegen", "prost", "router"] }
# CLI-related dependencies
anyhow = { version = "1.0", optional = true }
@@ -64,9 +64,13 @@ default = []
flight-sql = ["dep:arrow-arith", "dep:arrow-data", "dep:arrow-ord",
"dep:arrow-row", "dep:arrow-select", "dep:arrow-string", "dep:once_cell",
"dep:paste"]
# TODO: Remove in the next release
flight-sql-experimental = ["flight-sql"]
-tls = ["tonic/tls"]
+tls-aws-lc= ["tonic/tls-aws-lc"]
+tls-native-roots = ["tonic/tls-native-roots"]
+tls-ring = ["tonic/tls-ring"]
+tls-webpki-roots = ["tonic/tls-webpki-roots"]
+
# 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"]
+cli = ["arrow-array/chrono-tz", "arrow-cast/prettyprint",
"tonic/tls-webpki-roots", "dep:anyhow", "dep:clap", "dep:tracing-log",
"dep:tracing-subscriber", "dep:tokio"]
[dev-dependencies]
arrow-cast = { workspace = true, features = ["prettyprint"] }
@@ -85,18 +89,18 @@ uuid = { version = "1.10.0", features = ["v4"] }
[[example]]
name = "flight_sql_server"
-required-features = ["flight-sql", "tls"]
+required-features = ["flight-sql", "tls-ring"]
[[bin]]
name = "flight_sql_client"
-required-features = ["cli", "flight-sql", "tls"]
+required-features = ["cli", "flight-sql", "tls-ring"]
[[test]]
name = "flight_sql_client"
path = "tests/flight_sql_client.rs"
-required-features = ["flight-sql", "tls"]
+required-features = ["flight-sql", "tls-ring"]
[[test]]
name = "flight_sql_client_cli"
path = "tests/flight_sql_client_cli.rs"
-required-features = ["cli", "flight-sql", "tls"]
+required-features = ["cli", "flight-sql", "tls-ring"]
diff --git a/arrow-flight/README.md b/arrow-flight/README.md
index cc898ecaa1..1cd8f5cfe2 100644
--- a/arrow-flight/README.md
+++ b/arrow-flight/README.md
@@ -45,7 +45,14 @@ that demonstrate how to build a Flight server implemented
with [tonic](https://d
- `flight-sql`: Support for [Apache Arrow FlightSQL], a protocol for
interacting with SQL databases.
-- `tls`: Enables `tls` on `tonic`
+You can enable TLS using the following features (not enabled by default)
+
+- `tls-aws-lc`: enables [tonic feature] `tls-aws-lc`
+- `tls-native-roots`: enables [tonic feature] `tls-native-roots`
+- `tls-ring`: enables [tonic feature] `tls-ring`
+- `tls-webpki`: enables [tonic feature] `tls-webpki-roots`
+
+[tonic feature]: https://docs.rs/tonic/latest/tonic/#feature-flags
## CLI
diff --git a/arrow-flight/examples/flight_sql_server.rs
b/arrow-flight/examples/flight_sql_server.rs
index b0dc9b1b74..f2837de7c7 100644
--- a/arrow-flight/examples/flight_sql_server.rs
+++ b/arrow-flight/examples/flight_sql_server.rs
@@ -814,7 +814,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).with_nodelay(Some(true));
(incoming, addr)
}
diff --git a/arrow-flight/gen/Cargo.toml b/arrow-flight/gen/Cargo.toml
index 79d46cd377..9e509e4fad 100644
--- a/arrow-flight/gen/Cargo.toml
+++ b/arrow-flight/gen/Cargo.toml
@@ -33,4 +33,4 @@ publish = false
# Pin specific version of the tonic-build dependencies to avoid auto-generated
# (and checked in) arrow.flight.protocol.rs from changing
prost-build = { version = "=0.13.5", default-features = false }
-tonic-build = { version = "=0.12.3", default-features = false, features =
["transport", "prost"] }
+tonic-build = { version = "=0.13.1", default-features = false, features =
["transport", "prost"] }
diff --git a/arrow-flight/src/arrow.flight.protocol.rs
b/arrow-flight/src/arrow.flight.protocol.rs
index 0cd4f6948b..a08ea01105 100644
--- a/arrow-flight/src/arrow.flight.protocol.rs
+++ b/arrow-flight/src/arrow.flight.protocol.rs
@@ -448,7 +448,7 @@ pub mod flight_service_client {
}
impl<T> FlightServiceClient<T>
where
- T: tonic::client::GrpcService<tonic::body::BoxBody>,
+ T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
@@ -469,13 +469,13 @@ pub mod flight_service_client {
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
- http::Request<tonic::body::BoxBody>,
+ http::Request<tonic::body::Body>,
Response = http::Response<
- <T as
tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
+ <T as
tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
- http::Request<tonic::body::BoxBody>,
+ http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
FlightServiceClient::new(InterceptedService::new(inner,
interceptor))
@@ -1098,7 +1098,7 @@ pub mod flight_service_server {
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
- type Response = http::Response<tonic::body::BoxBody>;
+ type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
@@ -1571,7 +1571,9 @@ pub mod flight_service_server {
}
_ => {
Box::pin(async move {
- let mut response = http::Response::new(empty_body());
+ let mut response = http::Response::new(
+ tonic::body::Body::default(),
+ );
let headers = response.headers_mut();
headers
.insert(
diff --git a/arrow-integration-testing/Cargo.toml
b/arrow-integration-testing/Cargo.toml
index 8654b4b927..8e91fcbb3c 100644
--- a/arrow-integration-testing/Cargo.toml
+++ b/arrow-integration-testing/Cargo.toml
@@ -43,7 +43,7 @@ prost = { version = "0.13", default-features = false }
serde = { version = "1.0", default-features = false, features = ["rc",
"derive"] }
serde_json = { version = "1.0", default-features = false, features = ["std"] }
tokio = { version = "1.0", default-features = false, features = [
"rt-multi-thread"] }
-tonic = { version = "0.12", default-features = false }
+tonic = { version = "0.13", default-features = false }
tracing-subscriber = { version = "0.3.1", default-features = false, features =
["fmt"], optional = true }
flate2 = { version = "1", default-features = false, features =
["rust_backend"] }