Merge pull request #22459 from grpc/vjpai-patch-1

Register CQ at the right place
pull/22461/head
Vijay Pai 5 years ago committed by GitHub
commit 4e79cda71c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/cpp/server/server_cc.cc

@ -1241,6 +1241,12 @@ void Server::Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) {
RegisterCallbackGenericService(unimplemented_service_.get()); 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_); grpc_server_start(server_);
if (!has_async_generic_service_ && !has_callback_generic_service_) { 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++) { for (size_t i = 0; i < num_cqs; i++) {
#ifndef NDEBUG
cq_list_.push_back(cqs[i]);
#endif
if (cqs[i]->IsFrequentlyPolled()) { if (cqs[i]->IsFrequentlyPolled()) {
new UnimplementedAsyncRequest(this, cqs[i]); new UnimplementedAsyncRequest(this, cqs[i]);
} }

Loading…
Cancel
Save