diff options
author | Gleb Vishnevsky <vishnevskiygl@yandex-team.ru> | 2024-06-12 17:18:32 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-06-12 17:30:15 +0300 |
commit | 5d89ff167f67790589638ad34d8fe19939d86347 (patch) | |
tree | 94d33035dee63b6f9b2ea8d815b0b882c2972647 | |
parent | 351551dff2848f48d322f8c144989f5bf9f2205f (diff) | |
download | ydb-5d89ff167f67790589638ad34d8fe19939d86347.tar.gz |
Increment timeout counter on dns resolve timeout
Seems to be a bug, `TimeoutCounter` is created in `TDnsResolver` but never incremented.
---
74769ed5efd79d43378bce375b4ce2c7a3e6c9e4
Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/642
-rw-r--r-- | yt/yt/core/dns/ares_dns_resolver.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/yt/yt/core/dns/ares_dns_resolver.cpp b/yt/yt/core/dns/ares_dns_resolver.cpp index de65cce865..45377f7e96 100644 --- a/yt/yt/core/dns/ares_dns_resolver.cpp +++ b/yt/yt/core/dns/ares_dns_resolver.cpp @@ -457,11 +457,12 @@ private: #endif } - static void OnRequestTimeout(TPromise<TNetworkAddress> promise, TGuid requestId) + void OnRequestTimeout(TPromise<TNetworkAddress> promise, TGuid requestId) { auto timeoutError = TError(NNet::EErrorCode::ResolveTimedOut, "Ares DNS resolve timed out"); if (promise.TrySet(std::move(timeoutError))) { + TimeoutCounter_.Increment(); YT_LOG_WARNING( "Ares DNS resolve timed out (RequestId: %v)", requestId); @@ -601,7 +602,7 @@ private: auto promise = NewPromise<TNetworkAddress>(); auto timeoutCookie = TDelayedExecutor::Submit( - BIND(&TAresDnsResolver::OnRequestTimeout, promise, requestId), + BIND(&TAresDnsResolver::OnRequestTimeout, MakeStrong(this), promise, requestId), Config_->MaxResolveTimeout); return std::make_unique<TResolveRequest>(TResolveRequest{ |