Merge pull request #23300 from jiangtaoli2016/alts_envoy

Fix ALTS shutdown crash on envoy
pull/23309/head
Jiangtao Li 5 years ago committed by GitHub
commit 925a3daeff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/core/tsi/alts/handshaker/alts_handshaker_client.cc

@ -658,12 +658,19 @@ static void handshaker_client_destruct(alts_handshaker_client* c) {
// TODO(apolcyn): we could remove this indirection and call
// grpc_call_unref inline if there was an internal variant of
// grpc_call_unref that didn't need to flush an ExecCtx.
if (grpc_core::ExecCtx::Get() == nullptr) {
// Unref handshaker call if there is no exec_ctx, e.g., in the case of
// Envoy ALTS transport socket.
grpc_call_unref(client->call);
} else {
// Using existing exec_ctx to unref handshaker call.
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
GRPC_CLOSURE_CREATE(handshaker_call_unref, client->call,
grpc_schedule_on_exec_ctx),
GRPC_ERROR_NONE);
}
}
}
static const alts_handshaker_client_vtable vtable = {

Loading…
Cancel
Save