diff --git a/ydb/core/fq/libs/compute/ydb/control_plane/compute_database_control_plane_service.cpp b/ydb/core/fq/libs/compute/ydb/control_plane/compute_database_control_plane_service.cpp index 60ed347d82b7..e6cb95298d41 100644 --- a/ydb/core/fq/libs/compute/ydb/control_plane/compute_database_control_plane_service.cpp +++ b/ydb/core/fq/libs/compute/ydb/control_plane/compute_database_control_plane_service.cpp @@ -364,17 +364,21 @@ class TComputeDatabaseControlPlaneServiceActor : public NActors::TActorBootstrap return settings; } - static NGrpcActorClient::TGrpcClientSettings CreateGrpcClientSettings(const NConfig::TComputeDatabaseConfig& config) { + static NGrpcActorClient::TGrpcClientSettings CreateGrpcClientSettings(const auto& connection) { NGrpcActorClient::TGrpcClientSettings settings; - const auto& connection = config.GetControlPlaneConnection(); settings.Endpoint = connection.GetEndpoint(); settings.EnableSsl = connection.GetUseSsl(); if (connection.GetCertificateFile()) { settings.CertificateRootCA = StripString(TFileInput(connection.GetCertificateFile()).ReadAll()); } + settings.RequestTimeoutMs = 20 * 1000; // todo: read from config return settings; } + static NGrpcActorClient::TGrpcClientSettings CreateGrpcClientSettings(const NConfig::TComputeDatabaseConfig& config) { + return CreateGrpcClientSettings(config.GetControlPlaneConnection()); + } + void CreateSingleClientActors(const NConfig::TYdbComputeControlPlane::TSingle& singleConfig) { auto globalLoadConfig = Config.GetYdb().GetLoadControlConfig(); if (globalLoadConfig.GetEnable()) { diff --git a/ydb/library/grpc/actor_client/grpc_service_client.h b/ydb/library/grpc/actor_client/grpc_service_client.h index e51d1483f4c5..3ee1378b4dcb 100644 --- a/ydb/library/grpc/actor_client/grpc_service_client.h +++ b/ydb/library/grpc/actor_client/grpc_service_client.h @@ -117,7 +117,8 @@ class TGrpcServiceClient { } static NYdbGrpc::TGRpcClientConfig InitGrpcConfig(const NGrpcActorClient::TGrpcClientSettings& settings) { - NYdbGrpc::TGRpcClientConfig config(settings.Endpoint, DEFAULT_TIMEOUT, NYdbGrpc::DEFAULT_GRPC_MESSAGE_SIZE_LIMIT, 0, settings.CertificateRootCA); + const TDuration effectiveTimeout = settings.RequestTimeoutMs ? TDuration::Milliseconds(settings.RequestTimeoutMs) : DEFAULT_TIMEOUT; + NYdbGrpc::TGRpcClientConfig config(settings.Endpoint, effectiveTimeout, NYdbGrpc::DEFAULT_GRPC_MESSAGE_SIZE_LIMIT, 0, settings.CertificateRootCA); config.EnableSsl = settings.EnableSsl; config.IntChannelParams[GRPC_ARG_KEEPALIVE_TIME_MS] = settings.GrpcKeepAliveTimeMs; config.IntChannelParams[GRPC_ARG_KEEPALIVE_TIMEOUT_MS] = settings.GrpcKeepAliveTimeoutMs; diff --git a/ydb/library/grpc/actor_client/grpc_service_settings.h b/ydb/library/grpc/actor_client/grpc_service_settings.h index 0e7d3775ae20..af602d1f1d48 100644 --- a/ydb/library/grpc/actor_client/grpc_service_settings.h +++ b/ydb/library/grpc/actor_client/grpc_service_settings.h @@ -11,6 +11,7 @@ struct TGrpcClientSettings { ui32 GrpcKeepAliveTimeoutMs = 1000; ui32 GrpcKeepAlivePingInterval = 5000; bool EnableSsl = false; + ui64 RequestTimeoutMs = 0; // zero means 10 seconds }; } // namespace NGrpcActorClient