From 5abebaaadbf12701d704ca5fb67bcedb34254386 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 6 Dec 2023 21:06:01 +0000 Subject: [PATCH] fix --- src/core/lib/transport/transport.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h index 8fe728bb978..f34692c8ddc 100644 --- a/src/core/lib/transport/transport.h +++ b/src/core/lib/transport/transport.h @@ -251,6 +251,15 @@ class CallSpineInterface { virtual void IncrementRefCount() = 0; virtual void Unref() = 0; + // Cancel the call with the given metadata. + // Regarding the `MUST_USE_RESULT absl::nullopt_t`: + // Most cancellation calls right now happen in pipe interceptors; + // there `nullopt` indicates terminate processing of this pipe and close with + // error. + // It's convenient then to have the Cancel operation (setting the latch to + // terminate the call) be the last thing that occurs in a pipe interceptor, + // and this construction supports that (and has helped the author not write + // some bugs). GRPC_MUST_USE_RESULT absl::nullopt_t Cancel(ServerMetadataHandle metadata) { GPR_DEBUG_ASSERT(Activity::current() == &party()); auto& c = cancel_latch();