Skip to content

Commit

Permalink
[Backport] Ensure the Chttp2Connector is deleted under an ExecCtx. (g…
Browse files Browse the repository at this point in the history
…rpc#37315)

Backport grpc#37134 to v1.65

Co-authored-by: Vignesh Babu <[email protected]>
  • Loading branch information
yashykt and Vignesh2208 authored Jul 25, 2024
1 parent c8ea3d7 commit a699463
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/ext/transport/chttp2/client/chttp2_connector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ void Chttp2Connector::OnHandshakeDone(void* arg, grpc_error_handle error) {
&self->on_receive_settings_, self->args_.interested_parties, nullptr);
self->timer_handle_ = self->event_engine_->RunAfter(
self->args_.deadline - Timestamp::Now(),
[self = self->RefAsSubclass<Chttp2Connector>()] {
[self = self->RefAsSubclass<Chttp2Connector>()]() mutable {
ApplicationCallbackExecCtx callback_exec_ctx;
ExecCtx exec_ctx;
self->OnTimeout();
// Ensure the Chttp2Connector is deleted under an ExecCtx.
self.reset();
});
} else {
// If the handshaking succeeded but there is no endpoint, then the
Expand Down

0 comments on commit a699463

Please sign in to comment.