diff options
author | Vitalii Gridnev <gridnevvvit@gmail.com> | 2022-02-10 16:47:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:25 +0300 |
commit | dc5feacd15e76abe98d23fe0d4ea3c02cb8de60f (patch) | |
tree | 9814fbd1c3effac9b8377c5d604b367b14e2db55 /library/cpp/grpc | |
parent | 30ed3937ab02d1b3c4dec4d93fb86c683217d9be (diff) | |
download | ydb-dc5feacd15e76abe98d23fe0d4ea3c02cb8de60f.tar.gz |
Restoring authorship annotation for Vitalii Gridnev <gridnevvvit@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/grpc')
-rw-r--r-- | library/cpp/grpc/server/grpc_server.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/library/cpp/grpc/server/grpc_server.cpp b/library/cpp/grpc/server/grpc_server.cpp index a9c67cebda..7437b7a8f5 100644 --- a/library/cpp/grpc/server/grpc_server.cpp +++ b/library/cpp/grpc/server/grpc_server.cpp @@ -133,14 +133,14 @@ void TGRpcServer::Start() { } if (Options_.GRpcMemoryQuotaBytes) { - // See details KIKIMR-6932 + // See details KIKIMR-6932 /* grpc::ResourceQuota quota("memory_bound"); quota.Resize(Options_.GRpcMemoryQuotaBytes); builder.SetResourceQuota(quota); */ - Cerr << "GRpc memory quota temporarily disabled due to issues with grpc quoter" << Endl; + Cerr << "GRpc memory quota temporarily disabled due to issues with grpc quoter" << Endl; } Options_.ServerBuilderMutator(builder); builder.SetDefaultCompressionLevel(Options_.DefaultCompressionLevel); @@ -191,7 +191,7 @@ void TGRpcServer::Stop() { Server_->Shutdown(gpr_timespec{sec, nanosecOfSec, GPR_TIMESPAN}); } - for (ui64 attempt = 0; ; ++attempt) { + for (ui64 attempt = 0; ; ++attempt) { bool unsafe = false; size_t infly = 0; for (auto& service : Services_) { @@ -201,13 +201,13 @@ void TGRpcServer::Stop() { if (!unsafe && !infly) break; - + auto spent = (TInstant::Now() - now).SecondsFloat(); - if (attempt % 300 == 0) { - // don't log too much - Cerr << "GRpc shutdown warning: left infly: " << infly << ", spent: " << spent << " sec" << Endl; - } - + if (attempt % 300 == 0) { + // don't log too much + Cerr << "GRpc shutdown warning: left infly: " << infly << ", spent: " << spent << " sec" << Endl; + } + if (!unsafe && spent > Options_.GRpcShutdownDeadline.SecondsFloat()) break; Sleep(TDuration::MilliSeconds(10)); |