Skip to content

Commit b21290b

Browse files
meta deadline exceeded (#10101)
1 parent 9781dce commit b21290b

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

ydb/mvp/core/core_ydb.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "core_ydb.h"
22
#include "core_ydb_impl.h"
3+
#include "mvp_tokens.h"
34

45
#include <ydb/library/actors/http/http_cache.h>
56

@@ -408,3 +409,10 @@ TString GetAuthHeaderValue(const TString& tokenName) {
408409
}
409410
return authHeaderValue;
410411
}
412+
413+
void SetGrpcKeepAlive(NYdbGrpc::TGRpcClientConfig& config) {
414+
config.IntChannelParams[GRPC_ARG_KEEPALIVE_TIME_MS] = 20000;
415+
config.IntChannelParams[GRPC_ARG_KEEPALIVE_TIMEOUT_MS] = 10000;
416+
config.IntChannelParams[GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA] = 0;
417+
config.IntChannelParams[GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS] = 1;
418+
}

ydb/mvp/core/core_ydb.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <util/generic/strbuf.h>
1717
#include <library/cpp/deprecated/atomic/atomic.h>
1818
#include "grpc_log.h"
19-
#include "mvp_tokens.h"
2019

2120
template <typename T>
2221
class TAtomicSingleton {
@@ -142,6 +141,9 @@ struct TYdbUnitResources {
142141

143142
extern TMap<std::pair<TStringBuf, TStringBuf>, TYdbUnitResources> DefaultUnitResources;
144143

144+
TString GetAuthHeaderValue(const TString& tokenName);
145+
void SetGrpcKeepAlive(NYdbGrpc::TGRpcClientConfig& config);
146+
145147
struct TYdbLocation {
146148
TString Name;
147149
TString Environment;
@@ -257,6 +259,7 @@ struct TYdbLocation {
257259
config.SslCredentials.pem_root_certs = certificate;
258260
}
259261
config.EnableSsl = ssl;
262+
SetGrpcKeepAlive(config);
260263
return CreateGRpcServiceConnection<TGRpcService>(config);
261264
}
262265

@@ -272,6 +275,7 @@ struct TYdbLocation {
272275
if (config.EnableSsl && CaCertificate) {
273276
config.SslCredentials.pem_root_certs = CaCertificate;
274277
}
278+
SetGrpcKeepAlive(config);
275279
return CreateGRpcServiceConnection<TGRpcService>(config);
276280
}
277281

@@ -350,5 +354,3 @@ struct TYdbLocation {
350354
return GRpcClientLow.GetRef();
351355
}
352356
};
353-
354-
TString GetAuthHeaderValue(const TString& tokenName);

ydb/mvp/core/mvp_tokens.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ class TMvpTokenator : public NActors::TActorBootstrapped<TMvpTokenator> {
140140
NYdbGrpc::TGRpcClientConfig config;
141141
config.Locator = host;
142142
config.EnableSsl = (scheme == "grpcs");
143+
SetGrpcKeepAlive(config);
143144
return std::unique_ptr<NMVP::TLoggedGrpcServiceConnection<TGRpcService>>(new NMVP::TLoggedGrpcServiceConnection<TGRpcService>(config, GRpcClientLow.CreateGRpcServiceConnection<TGRpcService>(config)));
144145
}
145146

ydb/mvp/oidc_proxy/openid_connect.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <ydb/library/actors/core/event_local.h>
77
#include <ydb/library/actors/http/http.h>
88
#include <ydb/library/grpc/client/grpc_client_low.h>
9+
#include <ydb/mvp/core/core_ydb.h>
910
#include "context.h"
1011

1112

@@ -60,6 +61,7 @@ std::unique_ptr<NYdbGrpc::TServiceConnection<TSessionService>> CreateGRpcService
6061
config.Locator = host;
6162
config.EnableSsl = (scheme == "grpcs");
6263
static NYdbGrpc::TGRpcClientLow client;
64+
SetGrpcKeepAlive(config);
6365
return client.CreateGRpcServiceConnection<TSessionService>(config);
6466
}
6567

0 commit comments

Comments
 (0)