Skip to content

Commit

Permalink
fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
markdroth committed Feb 10, 2025
1 parent 2442f61 commit a3958eb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/core/xds/xds_client/xds_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -473,18 +473,22 @@ void XdsClient::XdsChannel::SubscribeLocked(const XdsResourceType* type,
bool XdsClient::XdsChannel::UnsubscribeLocked(const XdsResourceType* type,
const XdsResourceName& name,
bool delay_unsubscription) {
bool cached_resource_can_be_removed = true;
if (ads_call_ != nullptr) {
auto* call = ads_call_->call();
if (call != nullptr) {
cached_resource_can_be_removed =
bool cached_resource_can_be_removed =
call->UnsubscribeLocked(type, name, delay_unsubscription);
if (!call->HasSubscribedResources()) {
ads_call_.reset();
// We won't actually be sending the unsubscription, so the
// caller should remove the cached resource immediately.
return true;
}
return cached_resource_can_be_removed;
}
}
return cached_resource_can_be_removed;
// No ADS call, so caller should remove the cached resource.
return true;
}

bool XdsClient::XdsChannel::MaybeFallbackLocked(
Expand Down

0 comments on commit a3958eb

Please sign in to comment.