You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/05 13:38:08 UTC
[GitHub] [arrow-ballista] andygrove commented on a diff in pull request #115: Add timeout and keep-alive settings for Grpc Client and Server
andygrove commented on code in PR #115:
URL: https://github.com/apache/arrow-ballista/pull/115#discussion_r938824393
##########
ballista/rust/core/src/utils.rs:
##########
@@ -310,3 +313,32 @@ impl<T: 'static + AsLogicalPlan> QueryPlanner for BallistaQueryPlanner<T> {
}
}
}
+
+pub async fn create_grpc_client_connection<D>(
+ dst: D,
+) -> std::result::Result<Channel, Error>
+where
+ D: std::convert::TryInto<tonic::transport::Endpoint>,
+ D::Error: Into<StdError>,
+{
+ let endpoint = tonic::transport::Endpoint::new(dst)?
+ .connect_timeout(Duration::from_secs(20))
+ .timeout(Duration::from_secs(20))
+ // Disable Nagle's Algorithm since we don't want packets to wait
+ .tcp_nodelay(true)
+ .tcp_keepalive(Option::Some(Duration::from_secs(3600)))
+ .http2_keep_alive_interval(Duration::from_secs(300))
+ .keep_alive_timeout(Duration::from_secs(20))
+ .keep_alive_while_idle(true);
Review Comment:
It would be nice to make these options user-configurable via the recently added config mechanism that was added in DataFusion (but not integrated with Ballista yet).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org