From e57dd66c9d2cb9ee804d2b3c384ac8b19d86133a Mon Sep 17 00:00:00 2001
From: "Nicolas \"Pixel\" Noble" <pixel@nobis-crew.org>
Date: Wed, 24 Jun 2015 23:28:05 +0200
Subject: [PATCH] Cascade-kick pollsets when shutting down.

In the case we're using a threadpool, depending on where the threads are waiting in completion queue's next, they'll get stuck on shutdown because we're only kicking one of them. Instead, let's cascade-kick the pollsets when we shutdown so that we make sure all of them are exitting properly.
---
 src/core/surface/completion_queue.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c
index bd0fabf9da..063a23cfb1 100644
--- a/src/core/surface/completion_queue.c
+++ b/src/core/surface/completion_queue.c
@@ -208,6 +208,7 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc,
     }
     if (cc->shutdown) {
       ev = create_shutdown_event();
+      grpc_pollset_kick(&cc->pollset);
       break;
     }
     if (!grpc_pollset_work(&cc->pollset, deadline)) {
-- 
GitLab