Skip to content

Commit ca39c1d

Browse files
authored
[C++ SDK] Enabled gRPC keep alive by default (#20731)
1 parent 9184024 commit ca39c1d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/driver/driver.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,12 @@ class TDriverConfig {
8989
//! Params is a optionally field to set policy settings
9090
//! default: EBalancingPolicy::UsePreferableLocation
9191
TDriverConfig& SetBalancingPolicy(EBalancingPolicy policy, const std::string& params = std::string());
92-
//! !!! EXPERIMENTAL !!!
9392
//! Set grpc level keep alive. If keepalive ping was delayed more than given timeout
9493
//! internal grpc routine fails request with TRANSIENT_FAILURE or TRANSPORT_UNAVAILABLE error
9594
//! Note: this timeout should not be too small to prevent fail due to
9695
//! network buffers delay. I.e. values less than 5 seconds may cause request failure
9796
//! even with fast network
98-
//! default: disabled
97+
//! default: enabled, 10 seconds
9998
TDriverConfig& SetGRpcKeepAliveTimeout(TDuration timeout);
10099
TDriverConfig& SetGRpcKeepAlivePermitWithoutCalls(bool permitWithoutCalls);
101100
//! Set inactive socket timeout.

ydb/public/sdk/cpp/src/client/driver/driver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ class TDriverConfig::TImpl : public IConnectionsParams {
7070
};
7171
bool DrainOnDtors = true;
7272
TBalancingSettings BalancingSettings = TBalancingSettings{EBalancingPolicy::UsePreferableLocation, std::string()};
73-
TDuration GRpcKeepAliveTimeout;
74-
bool GRpcKeepAlivePermitWithoutCalls = false;
73+
TDuration GRpcKeepAliveTimeout = TDuration::Seconds(10);
74+
bool GRpcKeepAlivePermitWithoutCalls = true;
7575
TDuration SocketIdleTimeout = TDuration::Minutes(6);
7676
uint64_t MemoryQuota = 0;
7777
uint64_t MaxInboundMessageSize = 0;

0 commit comments

Comments
 (0)