diff options
author | 2017-05-26 09:45:16 -0700 | |
---|---|---|
committer | 2017-05-26 09:45:16 -0700 | |
commit | f809ca334c867566d615f6c99954323dc37ab288 (patch) | |
tree | b9081f067ca871832330f2c59e522ef11648646a | |
parent | 1e960fc80aed7bc391bed720202ff4f4e39b9a5b (diff) |
Prevent shutdown kick-spam
-rw-r--r-- | src/core/lib/surface/completion_queue.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c index 42e2e72710..651afe685c 100644 --- a/src/core/lib/surface/completion_queue.c +++ b/src/core/lib/surface/completion_queue.c @@ -864,7 +864,8 @@ static grpc_event cq_next(grpc_completion_queue *cq, gpr_timespec deadline, grpc_exec_ctx_finish(&exec_ctx); GPR_ASSERT(is_finished_arg.stolen_completion == NULL); - if (cq_event_queue_num_items(&cqd->queue) > 0) { + if (cq_event_queue_num_items(&cqd->queue) > 0 && + gpr_atm_no_barrier_load(&cqd->shutdown) == 0) { gpr_mu_lock(cqd->mu); cq->poller_vtable->kick(POLLSET_FROM_CQ(cq), NULL); gpr_mu_unlock(cqd->mu); |