Remove subchannel_destroyed_

reviewable/pr19463/r2
Hope Casey-Allen 5 years ago
parent a240860008
commit 3c72a939fc
  1. 7
      src/core/ext/filters/client_channel/client_channel_channelz.cc
  2. 6
      src/core/ext/filters/client_channel/client_channel_channelz.h
  3. 2
      src/core/ext/filters/client_channel/subchannel.cc

@ -33,7 +33,6 @@ namespace channelz {
SubchannelNode::SubchannelNode(const char* target_address,
size_t channel_tracer_max_nodes)
: BaseNode(EntityType::kSubchannel),
subchannel_destroyed_(false),
target_(UniquePtr<char>(gpr_strdup(target_address))),
trace_(channel_tracer_max_nodes) {}
@ -49,11 +48,7 @@ void SubchannelNode::SetChildSocketUuid(intptr_t uuid) {
void SubchannelNode::PopulateConnectivityState(grpc_json* json) {
grpc_connectivity_state state;
if (subchannel_destroyed_) {
state = GRPC_CHANNEL_SHUTDOWN;
} else {
state = connectivity_state_.Load(MemoryOrder::RELAXED);
}
state = connectivity_state_.Load(MemoryOrder::RELAXED);
json = grpc_json_create_child(nullptr, json, "state", nullptr,
GRPC_JSON_OBJECT, false);
grpc_json_create_child(nullptr, json, "state",

@ -37,11 +37,6 @@ class SubchannelNode : public BaseNode {
SubchannelNode(const char* target_address, size_t channel_tracer_max_nodes);
~SubchannelNode() override;
void MarkSubchannelDestroyed() {
GPR_ASSERT(!subchannel_destroyed_);
subchannel_destroyed_ = true;
}
// Used when the subchannel's transport connectivity state changes.
void UpdateConnectivityState(grpc_connectivity_state state);
@ -70,7 +65,6 @@ class SubchannelNode : public BaseNode {
private:
void PopulateConnectivityState(grpc_json* json);
bool subchannel_destroyed_;
Atomic<grpc_connectivity_state> connectivity_state_{GRPC_CHANNEL_IDLE};
Atomic<intptr_t> child_socket_uuid_{0};
UniquePtr<char> target_;

@ -691,7 +691,7 @@ Subchannel::~Subchannel() {
channelz_node_->AddTraceEvent(
channelz::ChannelTrace::Severity::Info,
grpc_slice_from_static_string("Subchannel destroyed"));
channelz_node_->MarkSubchannelDestroyed();
channelz_node_->UpdateConnectivityState(GRPC_CHANNEL_SHUTDOWN);
}
grpc_channel_args_destroy(args_);
grpc_connector_unref(connector_);

Loading…
Cancel
Save