From 67bfefdbd13fa1f8370d0da33ef52612fa338038 Mon Sep 17 00:00:00 2001
From: Craig Tiller <ctiller@google.com>
Date: Thu, 30 Apr 2015 09:32:37 -0700
Subject: [PATCH] Ensure call alarms are cancelled when the underlying stream
 closes

---
 src/core/surface/call.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index 6ca1b4e9a1..50333eac17 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -727,6 +727,10 @@ static void call_on_done_recv(void *pc, int success) {
     if (call->recv_state == GRPC_STREAM_CLOSED) {
       GPR_ASSERT(call->read_state <= READ_STATE_STREAM_CLOSED);
       call->read_state = READ_STATE_STREAM_CLOSED;
+      if (call->have_alarm) {
+        grpc_alarm_cancel(&call->alarm);
+        call->have_alarm = 0;
+      }
     }
     finish_read_ops(call);
   } else {
-- 
GitLab