Skip to content

Commit

Permalink
Merge pull request #390 from markdroth/create-pull-request/patch-79eb274
Browse files Browse the repository at this point in the history
Automated fix for refs/heads/xds_client_nested_channel_shutdown_deadlock_fix
  • Loading branch information
markdroth authored Aug 29, 2023
2 parents 79eb274 + a081e6c commit 75f30db
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/core/ext/xds/xds_transport_grpc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <grpc/byte_buffer.h>
#include <grpc/byte_buffer_reader.h>
#include <grpc/event_engine/event_engine.h>
#include <grpc/grpc.h>
#include <grpc/impl/channel_arg_names.h>
#include <grpc/impl/connectivity_state.h>
Expand All @@ -42,11 +43,13 @@
#include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/event_engine/default_event_engine.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/security/credentials/channel_creds_registry.h"
#include "src/core/lib/security/credentials/credentials.h"
Expand Down Expand Up @@ -305,12 +308,11 @@ void GrpcXdsTransportFactory::GrpcXdsTransport::Orphan() {
// Do an async hop before unreffing. This avoids a deadlock upon
// shutdown in the case where the xDS channel is itself an xDS channel
// (e.g., when using one control plane to find another control plane).
grpc_event_engine::experimental::GetDefaultEventEngine()->Run(
[this]() {
ApplicationCallbackExecCtx application_exec_ctx;
ExecCtx exec_ctx;
Unref();
});
grpc_event_engine::experimental::GetDefaultEventEngine()->Run([this]() {
ApplicationCallbackExecCtx application_exec_ctx;
ExecCtx exec_ctx;
Unref();
});
}

OrphanablePtr<XdsTransportFactory::XdsTransport::StreamingCall>
Expand Down

0 comments on commit 75f30db

Please sign in to comment.