diff options
Diffstat (limited to 'library/cpp/yt/error/origin_attributes.cpp')
| -rw-r--r-- | library/cpp/yt/error/origin_attributes.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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<TFunctor>()(lhs, rhs); + } + return lhs == rhs; +} + //////////////////////////////////////////////////////////////////////////////// TOriginAttributes ExtractFromDictionary(TErrorAttributes* attributes) |
