CuteChuanChuan commented on code in PR #1337:
URL: 
https://github.com/apache/datafusion-ballista/pull/1337#discussion_r2462723588


##########
ballista/core/src/utils.rs:
##########
@@ -106,31 +107,50 @@ pub async fn collect_stream(
 
 pub async fn create_grpc_client_connection<D>(
     dst: D,
+    config: &BallistaConfig,

Review Comment:
   I derive `GrpcClientConfig` for this.



##########
ballista/core/src/utils.rs:
##########
@@ -106,31 +107,50 @@ pub async fn collect_stream(
 
 pub async fn create_grpc_client_connection<D>(
     dst: D,
+    config: &BallistaConfig,
 ) -> 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))
+        .connect_timeout(Duration::from_secs(
+            config.default_grpc_client_connect_timeout_seconds() as u64,
+        ))
+        .timeout(Duration::from_secs(
+            config.default_grpc_client_timeout_seconds() as u64,
+        ))
         // 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))
+        .tcp_keepalive(Option::Some(Duration::from_secs(
+            config.default_grpc_client_tcp_keepalive_seconds() as u64,
+        )))
+        .http2_keep_alive_interval(Duration::from_secs(
+            config.default_grpc_client_http2_keepalive_interval_seconds() as 
u64,
+        ))
+        .keep_alive_timeout(Duration::from_secs(
+            config.default_grpc_client_keepalive_timeout_seconds() as u64,
+        ))
         .keep_alive_while_idle(true);
     endpoint.connect().await
 }
 
-pub fn create_grpc_server() -> Server {
+pub fn create_grpc_server(config: &BallistaConfig) -> Server {

Review Comment:
   I derive `GrpcServerConfig` for this.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to