Skip to content

Commit a5a1ea1

Browse files
authored
Fix for cancelled calls (grpc#29213)
1 parent 23c4541 commit a5a1ea1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/core/lib/channel/promise_based_filter.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,15 @@ void ClientCallData::RecvTrailingMetadataReadyCallback(
264264
}
265265

266266
void ClientCallData::RecvTrailingMetadataReady(grpc_error_handle error) {
267+
// If we were cancelled prior to receiving this callback, we should simply
268+
// forward the callback up with the same error.
269+
if (recv_trailing_state_ == RecvTrailingState::kCancelled) {
270+
if (grpc_closure* call_closure =
271+
absl::exchange(original_recv_trailing_metadata_ready_, nullptr)) {
272+
Closure::Run(DEBUG_LOCATION, call_closure, GRPC_ERROR_REF(error));
273+
}
274+
return;
275+
}
267276
// If there was an error, we'll put that into the trailing metadata and
268277
// proceed as if there was not.
269278
if (error != GRPC_ERROR_NONE) {

0 commit comments

Comments
 (0)