diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index a187edda077..6e35f067886 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -1531,7 +1531,7 @@ void GrpcLb::ShutdownLocked() { GPR_ASSERT(child_channelz_node != nullptr); parent_channelz_node_->RemoveChildChannel(child_channelz_node->uuid()); } - grpc_channel_destroy(lb_channel_); + grpc_channel_destroy_internal(lb_channel_); lb_channel_ = nullptr; } } diff --git a/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc b/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc index d72e456c0e5..687a7d8fc5c 100644 --- a/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +++ b/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc @@ -1631,7 +1631,7 @@ void RlsLb::RlsChannel::Orphan() { client_channel->RemoveConnectivityWatcher(watcher_); watcher_ = nullptr; } - grpc_channel_destroy(channel_); + grpc_channel_destroy_internal(channel_); } Unref(DEBUG_LOCATION, "Orphan"); } diff --git a/src/core/ext/xds/xds_transport_grpc.cc b/src/core/ext/xds/xds_transport_grpc.cc index 6f721653d8b..c16cf2119a6 100644 --- a/src/core/ext/xds/xds_transport_grpc.cc +++ b/src/core/ext/xds/xds_transport_grpc.cc @@ -291,7 +291,7 @@ GrpcXdsTransportFactory::GrpcXdsTransport::GrpcXdsTransport( } GrpcXdsTransportFactory::GrpcXdsTransport::~GrpcXdsTransport() { - grpc_channel_destroy(channel_); + grpc_channel_destroy_internal(channel_); } void GrpcXdsTransportFactory::GrpcXdsTransport::Orphan() { diff --git a/tools/run_tests/sanity/core_banned_functions.py b/tools/run_tests/sanity/core_banned_functions.py index 1b6ead3aaa9..9d2bf283927 100755 --- a/tools/run_tests/sanity/core_banned_functions.py +++ b/tools/run_tests/sanity/core_banned_functions.py @@ -47,6 +47,10 @@ BANNED_EXCEPT = { 'src/core/lib/slice/slice.cc', 'src/core/lib/slice/slice.h' ], 'grpc_call_cancel(': ['src/core/lib/surface/call.cc'], + 'grpc_channel_destroy(': [ + 'src/core/lib/surface/channel.cc', + 'src/core/tsi/alts/handshaker/alts_shared_resource.cc', + ], 'grpc_closure_create(': [ 'src/core/lib/iomgr/closure.cc', 'src/core/lib/iomgr/closure.h' ],