Merge pull request #19025 from markdroth/health_check_client_refcount_fix

Fix bug from #19002.
pull/19027/head
Mark D. Roth 6 years ago committed by GitHub
commit f9a5243fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/core/ext/filters/client_channel/health/health_check_client.cc

@ -323,6 +323,11 @@ void HealthCheckClient::CallState::StartCall() {
grpc_error* error = GRPC_ERROR_NONE;
call_ = health_check_client_->connected_subchannel_->CreateCall(args, &error)
.release();
// Register after-destruction callback.
GRPC_CLOSURE_INIT(&after_call_stack_destruction_, AfterCallStackDestruction,
this, grpc_schedule_on_exec_ctx);
call_->SetAfterCallStackDestroy(&after_call_stack_destruction_);
// Check if creation failed.
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR,
"HealthCheckClient %p CallState %p: error creating health "
@ -338,10 +343,6 @@ void HealthCheckClient::CallState::StartCall() {
GRPC_ERROR_NONE);
return;
}
// Register after-destruction callback.
GRPC_CLOSURE_INIT(&after_call_stack_destruction_, AfterCallStackDestruction,
this, grpc_schedule_on_exec_ctx);
call_->SetAfterCallStackDestroy(&after_call_stack_destruction_);
// Initialize payload and batch.
payload_.context = context_;
batch_.payload = &payload_;

Loading…
Cancel
Save