From e1ca454992cfc3bac3ad17435636646a603d7686 Mon Sep 17 00:00:00 2001 From: JeremyHi Date: Tue, 11 Jul 2023 15:07:18 +0800 Subject: [PATCH] chore: grpc-timeput = 10s (#1934) * chore: grpc-timeput = 10s * chore: fix ut --- src/common/grpc/src/channel_manager.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/grpc/src/channel_manager.rs b/src/common/grpc/src/channel_manager.rs index 6fe8993291..9bfa85f04e 100644 --- a/src/common/grpc/src/channel_manager.rs +++ b/src/common/grpc/src/channel_manager.rs @@ -28,7 +28,8 @@ use tower::make::MakeConnection; use crate::error::{CreateChannelSnafu, InvalidConfigFilePathSnafu, InvalidTlsConfigSnafu, Result}; const RECYCLE_CHANNEL_INTERVAL_SECS: u64 = 60; -const DEFAULT_REQUEST_TIMEOUT_SECS: u64 = 2; +const DEFAULT_REQUEST_TIMEOUT_SECS: u64 = 10; +const DEFAULT_CONNECT_TIMEOUT_SECS: u64 = 10; #[derive(Clone, Debug)] pub struct ChannelManager { @@ -238,7 +239,7 @@ impl Default for ChannelConfig { fn default() -> Self { Self { timeout: Some(Duration::from_secs(DEFAULT_REQUEST_TIMEOUT_SECS)), - connect_timeout: Some(Duration::from_secs(4)), + connect_timeout: Some(Duration::from_secs(DEFAULT_CONNECT_TIMEOUT_SECS)), concurrency_limit: None, rate_limit: None, initial_stream_window_size: None, @@ -499,7 +500,7 @@ mod tests { assert_eq!( ChannelConfig { timeout: Some(Duration::from_secs(DEFAULT_REQUEST_TIMEOUT_SECS)), - connect_timeout: Some(Duration::from_secs(4)), + connect_timeout: Some(Duration::from_secs(DEFAULT_CONNECT_TIMEOUT_SECS)), concurrency_limit: None, rate_limit: None, initial_stream_window_size: None,