From 69eb5824487f8f86c98e86aa08cb2aa579518d11 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Mon, 23 Mar 2020 12:51:45 -0700 Subject: [PATCH] Register CQ at the right place --- src/cpp/server/server_cc.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 34ffd59489f..a30e4911dc0 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -1241,6 +1241,12 @@ void Server::Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) { RegisterCallbackGenericService(unimplemented_service_.get()); } +#ifndef NDEBUG + for (size_t i = 0; i < num_cqs; i++) { + cq_list_.push_back(cqs[i]); + } +#endif + grpc_server_start(server_); if (!has_async_generic_service_ && !has_callback_generic_service_) { @@ -1249,9 +1255,6 @@ void Server::Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) { } for (size_t i = 0; i < num_cqs; i++) { -#ifndef NDEBUG - cq_list_.push_back(cqs[i]); -#endif if (cqs[i]->IsFrequentlyPolled()) { new UnimplementedAsyncRequest(this, cqs[i]); }