From 7ce6de4e577aa2d195fa5ec995df862c60484b63 Mon Sep 17 00:00:00 2001 From: mikari Date: Fri, 20 Feb 2026 21:39:29 +0300 Subject: Fixed error comparison commit_hash:76b32cc3992d0c6ce820f0b52a06deade4fa7558 --- library/cpp/yt/error/origin_attributes.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'library/cpp/yt/error/origin_attributes.cpp') diff --git a/library/cpp/yt/error/origin_attributes.cpp b/library/cpp/yt/error/origin_attributes.cpp index 69569762c49..e538670c73f 100644 --- a/library/cpp/yt/error/origin_attributes.cpp +++ b/library/cpp/yt/error/origin_attributes.cpp @@ -51,7 +51,8 @@ bool TOriginAttributes::operator==(const TOriginAttributes& other) const noexcep Datetime == other.Datetime && Pid == other.Pid && Tid == other.Tid && - ExtensionData == other.ExtensionData; + ExtensionData.has_value() == other.ExtensionData.has_value() && + (!ExtensionData.has_value() || NDetail::CompareExtensionData(*ExtensionData, *other.ExtensionData)); } void TOriginAttributes::Capture() @@ -106,6 +107,16 @@ std::string FormatOrigin(const TOriginAttributes& attributes) })); } +bool CompareExtensionData(const TOriginAttributes::TErasedExtensionData& lhs, const TOriginAttributes::TErasedExtensionData& rhs) +{ + using TFunctor = bool(*)(const TOriginAttributes::TErasedExtensionData&, const TOriginAttributes::TErasedExtensionData&); + + if (auto strong = NGlobal::GetErasedVariable(CompareExtensionDataTag)) { + return strong->AsConcrete()(lhs, rhs); + } + return lhs == rhs; +} + //////////////////////////////////////////////////////////////////////////////// TOriginAttributes ExtractFromDictionary(TErrorAttributes* attributes) -- cgit v1.3