diff options
author | babenko <babenko@yandex-team.com> | 2024-08-06 10:06:49 +0300 |
---|---|---|
committer | babenko <babenko@yandex-team.com> | 2024-08-06 10:16:32 +0300 |
commit | ec2f22a4794efe938e85da54c86f06e19b3173dc (patch) | |
tree | 6682b6bdd538d9c9f14c8eee3c9e7caf85331410 | |
parent | 957f0c255bd884c03bf673d354346180583537bb (diff) | |
download | ydb-ec2f22a4794efe938e85da54c86f06e19b3173dc.tar.gz |
Log connection abort message with proper logging level
ec2a88315813fe2a5b85361d4ef80d2de8bcd62c
-rw-r--r-- | yt/yt/core/bus/tcp/connection.cpp | 10 | ||||
-rw-r--r-- | yt/yt/core/bus/tcp/connection.h | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/yt/yt/core/bus/tcp/connection.cpp b/yt/yt/core/bus/tcp/connection.cpp index e6241815b4f..e084539c97c 100644 --- a/yt/yt/core/bus/tcp/connection.cpp +++ b/yt/yt/core/bus/tcp/connection.cpp @@ -215,8 +215,7 @@ void TTcpConnection::Start() if (!Poller_->TryRegister(this)) { auto error = TError(NBus::EErrorCode::TransportError, "Cannot register connection pollable"); - Abort(error); - YT_LOG_WARNING(error << *EndpointAttributes_, "Connection aborted"); + Abort(error, NLogging::ELogLevel::Warning); return; } @@ -226,8 +225,7 @@ void TTcpConnection::Start() InitBuffers(); } catch (const std::exception& ex) { auto error = TError(NBus::EErrorCode::TransportError, "I/O buffers allocation error") << ex; - Abort(error); - YT_LOG_WARNING(error << *EndpointAttributes_, "Connection aborted"); + Abort(error, NLogging::ELogLevel::Warning); return; } @@ -507,7 +505,7 @@ void TTcpConnection::SetupNetwork(const TNetworkAddress& address) } } -void TTcpConnection::Abort(const TError& error) +void TTcpConnection::Abort(const TError& error, NLogging::ELogLevel logLevel) { AbortSslSession(); @@ -545,7 +543,7 @@ void TTcpConnection::Abort(const TError& error) PendingControl_.fetch_or(static_cast<ui64>(EPollControl::Shutdown)); } - YT_LOG_DEBUG(detailedError, "Connection aborted"); + YT_LOG_EVENT(Logger, logLevel, detailedError, "Connection aborted"); // OnShutdown() will be called after draining events from thread pools. YT_UNUSED_FUTURE(Poller_->Unregister(this)); diff --git a/yt/yt/core/bus/tcp/connection.h b/yt/yt/core/bus/tcp/connection.h index ed395db9df4..05a5bdc62fc 100644 --- a/yt/yt/core/bus/tcp/connection.h +++ b/yt/yt/core/bus/tcp/connection.h @@ -288,7 +288,7 @@ private: void Close(); void CloseSslSession(ESslState newSslState); - void Abort(const TError& error); + void Abort(const TError& error, NLogging::ELogLevel logLevel = NLogging::ELogLevel::Debug); bool AbortIfNetworkingDisabled(); void AbortSslSession(); |