[xDS] remove thread-unsafe caching of locality names (#35862)

b/324102797

Closes #35862

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35862 from markdroth:lb_endpoint_iterator_crash_fix 74929498a8
PiperOrigin-RevId: 605462070
pull/35836/head
Mark D. Roth 1 year ago committed by Copybara-Service
parent 521b2ea17c
commit 009129b8e4
  1. 11
      src/core/ext/xds/xds_client_stats.h

@ -86,13 +86,9 @@ class XdsLocalityName : public RefCounted<XdsLocalityName> {
const std::string& zone() const { return zone_; }
const std::string& sub_zone() const { return sub_zone_; }
const std::string& AsHumanReadableString() {
if (human_readable_string_.empty()) {
human_readable_string_ =
absl::StrFormat("{region=\"%s\", zone=\"%s\", sub_zone=\"%s\"}",
region_, zone_, sub_zone_);
}
return human_readable_string_;
std::string AsHumanReadableString() const {
return absl::StrFormat("{region=\"%s\", zone=\"%s\", sub_zone=\"%s\"}",
region_, zone_, sub_zone_);
}
// Channel args traits.
@ -108,7 +104,6 @@ class XdsLocalityName : public RefCounted<XdsLocalityName> {
std::string region_;
std::string zone_;
std::string sub_zone_;
std::string human_readable_string_;
};
// Drop stats for an xds cluster.

Loading…
Cancel
Save