diff options
author | hor911 <hor911@ydb.tech> | 2022-09-29 12:37:49 +0300 |
---|---|---|
committer | hor911 <hor911@ydb.tech> | 2022-09-29 12:37:49 +0300 |
commit | f0dccf23552f6620c69d0533c0ef596dbcb2e18e (patch) | |
tree | 2bf83ee50f5eecb589dec7d8843715ed76f99f9e /library | |
parent | 415be0d1a1a30e2256bbf072fcec6c81cce8d706 (diff) | |
download | ydb-f0dccf23552f6620c69d0533c0ef596dbcb2e18e.tar.gz |
Pre resolve self address for discovery
Diffstat (limited to 'library')
-rw-r--r-- | library/cpp/actors/interconnect/interconnect_resolve.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/library/cpp/actors/interconnect/interconnect_resolve.cpp b/library/cpp/actors/interconnect/interconnect_resolve.cpp index 9d245f03ac..d638ff830c 100644 --- a/library/cpp/actors/interconnect/interconnect_resolve.cpp +++ b/library/cpp/actors/interconnect/interconnect_resolve.cpp @@ -1,6 +1,7 @@ #include "interconnect.h" #include "interconnect_address.h" #include "events_local.h" +#include "logging.h" #include <library/cpp/actors/core/actor_bootstrapped.h> #include <library/cpp/actors/core/hfunc.h> @@ -10,7 +11,10 @@ namespace NActors { using namespace NActors::NDnsResolver; - class TInterconnectResolveActor : public TActorBootstrapped<TInterconnectResolveActor> { + class TInterconnectResolveActor + : public TActorBootstrapped<TInterconnectResolveActor> + , public TInterconnectLoggingBase + { public: TInterconnectResolveActor( const TString& host, ui16 port, ui32 nodeId, const TString& defaultAddress, @@ -41,6 +45,7 @@ namespace NActors { void Bootstrap() { TMaybe<TString> errorText; if (auto addr = ExtractDefaultAddr(errorText)) { + LOG_TRACE_IC("ICR01", "Host: %s, CACHED address: %s", Host.c_str(), DefaultAddress.c_str()); if (NodeId) { return SendLocalNodeInfoAndDie({{*addr}}); } else { @@ -58,6 +63,7 @@ namespace NActors { return; } + LOG_DEBUG_IC("ICR02", "Host: %s, RESOLVING address ...", Host.c_str()); Send(MakeDnsResolverActorId(), NodeId ? static_cast<IEventBase*>(new TEvDns::TEvGetHostByName(Host, AF_UNSPEC)) @@ -111,6 +117,7 @@ namespace NActors { } void SendAddressInfoAndDie(NAddr::IRemoteAddrPtr addr) { + LOG_DEBUG_IC("ICR03", "Host: %s, RESOLVED address", Host.c_str()); auto reply = new TEvAddressInfo; reply->Address = std::move(addr); TActivationContext::Send(new IEventHandle(ReplyTo, ReplyFrom, reply)); @@ -118,6 +125,7 @@ namespace NActors { } void SendLocalNodeInfoAndDie(std::vector<NInterconnect::TAddress> addresses) { + LOG_DEBUG_IC("ICR04", "Host: %s, RESOLVED address", Host.c_str()); auto reply = std::make_unique<TEvLocalNodeInfo>(); reply->NodeId = *NodeId; reply->Addresses = std::move(addresses); @@ -126,6 +134,7 @@ namespace NActors { } void SendErrorAndDie(const TString& errorText) { + LOG_DEBUG_IC("ICR05", "Host: %s, ERROR resolving: %s", Host.c_str(), errorText.c_str()); auto *event = new TEvResolveError; event->Explain = errorText; event->Host = Host; |