From 18763aa8647a2fd3dfc7d2e7d0acc764b3bc5bcb Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Tue, 21 Jul 2020 13:00:12 -0700 Subject: [PATCH] Add comment --- src/core/ext/transport/chttp2/transport/chttp2_transport.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 46e749bc555..df648e4184d 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -2095,6 +2095,10 @@ void grpc_chttp2_cancel_stream(grpc_chttp2_transport* t, grpc_chttp2_stream* s, } if (due_to_error != GRPC_ERROR_NONE && !s->seen_error) { s->seen_error = true; + /* We are setting the fake status here instead of in + * grpc_chttp2_mark_stream_closed to handle the case where the stream is + * read and write closed, but not all callbacks have been made possibly due + * to pending data. */ grpc_chttp2_fake_status(t, s, GRPC_ERROR_REF(due_to_error)); } grpc_chttp2_mark_stream_closed(t, s, 1, 1, due_to_error);