Merge pull request #21841 from vjpai/qps_no_more_shutdown_thread

QPS test: Shutdown server properly before CQs
pull/22841/head
Vijay Pai 5 years ago committed by GitHub
commit 4a6d07747a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      test/cpp/qps/server_async.cc

@ -162,7 +162,10 @@ class AsyncQpsServerTest final : public grpc::testing::Server {
std::lock_guard<std::mutex> lock((*ss)->mutex); std::lock_guard<std::mutex> lock((*ss)->mutex);
(*ss)->shutdown = true; (*ss)->shutdown = true;
} }
std::thread shutdown_thread(&AsyncQpsServerTest::ShutdownThreadFunc, this); // TODO(vjpai): Remove the following deadline and allow full proper
// shutdown.
server_->Shutdown(std::chrono::system_clock::now() +
std::chrono::seconds(3));
for (auto cq = srv_cqs_.begin(); cq != srv_cqs_.end(); ++cq) { for (auto cq = srv_cqs_.begin(); cq != srv_cqs_.end(); ++cq) {
(*cq)->Shutdown(); (*cq)->Shutdown();
} }
@ -175,7 +178,6 @@ class AsyncQpsServerTest final : public grpc::testing::Server {
while ((*cq)->Next(&got_tag, &ok)) while ((*cq)->Next(&got_tag, &ok))
; ;
} }
shutdown_thread.join();
} }
int GetPollCount() override { int GetPollCount() override {
@ -192,12 +194,6 @@ class AsyncQpsServerTest final : public grpc::testing::Server {
} }
private: private:
void ShutdownThreadFunc() {
// TODO (vpai): Remove this deadline and allow Shutdown to finish properly
auto deadline = std::chrono::system_clock::now() + std::chrono::seconds(3);
server_->Shutdown(deadline);
}
void ThreadFunc(int thread_idx) { void ThreadFunc(int thread_idx) {
// Wait until work is available or we are shutting down // Wait until work is available or we are shutting down
bool ok; bool ok;

Loading…
Cancel
Save