|
|
@ -456,6 +456,7 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface { |
|
|
|
chand, this, subchannel_.get()); |
|
|
|
chand, this, subchannel_.get()); |
|
|
|
} |
|
|
|
} |
|
|
|
GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "SubchannelWrapper"); |
|
|
|
GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "SubchannelWrapper"); |
|
|
|
|
|
|
|
if (chand_->channelz_node_ != nullptr) { |
|
|
|
auto* subchannel_node = subchannel_->channelz_node(); |
|
|
|
auto* subchannel_node = subchannel_->channelz_node(); |
|
|
|
if (subchannel_node != nullptr) { |
|
|
|
if (subchannel_node != nullptr) { |
|
|
|
auto it = chand_->subchannel_refcount_map_.find(subchannel_.get()); |
|
|
|
auto it = chand_->subchannel_refcount_map_.find(subchannel_.get()); |
|
|
@ -466,6 +467,7 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface { |
|
|
|
} |
|
|
|
} |
|
|
|
++it->second; |
|
|
|
++it->second; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
chand_->subchannel_wrappers_.insert(this); |
|
|
|
chand_->subchannel_wrappers_.insert(this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -476,16 +478,19 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface { |
|
|
|
chand_, this, subchannel_.get()); |
|
|
|
chand_, this, subchannel_.get()); |
|
|
|
} |
|
|
|
} |
|
|
|
chand_->subchannel_wrappers_.erase(this); |
|
|
|
chand_->subchannel_wrappers_.erase(this); |
|
|
|
|
|
|
|
if (chand_->channelz_node_ != nullptr) { |
|
|
|
auto* subchannel_node = subchannel_->channelz_node(); |
|
|
|
auto* subchannel_node = subchannel_->channelz_node(); |
|
|
|
if (subchannel_node != nullptr) { |
|
|
|
if (subchannel_node != nullptr) { |
|
|
|
auto it = chand_->subchannel_refcount_map_.find(subchannel_.get()); |
|
|
|
auto it = chand_->subchannel_refcount_map_.find(subchannel_.get()); |
|
|
|
GPR_ASSERT(it != chand_->subchannel_refcount_map_.end()); |
|
|
|
GPR_ASSERT(it != chand_->subchannel_refcount_map_.end()); |
|
|
|
--it->second; |
|
|
|
--it->second; |
|
|
|
if (it->second == 0) { |
|
|
|
if (it->second == 0) { |
|
|
|
chand_->channelz_node_->RemoveChildSubchannel(subchannel_node->uuid()); |
|
|
|
chand_->channelz_node_->RemoveChildSubchannel( |
|
|
|
|
|
|
|
subchannel_node->uuid()); |
|
|
|
chand_->subchannel_refcount_map_.erase(it); |
|
|
|
chand_->subchannel_refcount_map_.erase(it); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "SubchannelWrapper"); |
|
|
|
GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "SubchannelWrapper"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|