From 207d1b81fe14dbaf12c78f23f79b7c012eb9a830 Mon Sep 17 00:00:00 2001 From: minqiyang Date: Thu, 5 Jul 2018 15:10:08 +0800 Subject: [PATCH] Add fixed grpc --- cmake/external/grpc.cmake | 2 +- .../operators/distributed/grpc_client.cc | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/cmake/external/grpc.cmake b/cmake/external/grpc.cmake index e06c337254..7828ba24aa 100644 --- a/cmake/external/grpc.cmake +++ b/cmake/external/grpc.cmake @@ -47,7 +47,7 @@ ExternalProject_Add( #URL "http://paddlepaddledeps.bj.bcebos.com/grpc-v1.10.x.tar.gz" URL "http://localhost:8000/grpc-v1.13.x.tar.gz" #URL_MD5 "1f268a2aff6759839dccd256adcc91cf" - URL_MD5 "27019f520a32161396b319e57c24a5ac" + URL_MD5 "c93a1ba08a449e5b800524131cc900a8" PREFIX ${GRPC_SOURCES_DIR} UPDATE_COMMAND "" CONFIGURE_COMMAND "" diff --git a/paddle/fluid/operators/distributed/grpc_client.cc b/paddle/fluid/operators/distributed/grpc_client.cc index c42f7e4326..7f16692d68 100644 --- a/paddle/fluid/operators/distributed/grpc_client.cc +++ b/paddle/fluid/operators/distributed/grpc_client.cc @@ -15,6 +15,7 @@ limitations under the License. */ #include "paddle/fluid/operators/distributed/grpc_client.h" #include +#include #include @@ -42,8 +43,32 @@ void GRPCClient::SendComplete() { } GRPCClient::~GRPCClient() { + LOG(ERROR) << "start sleep:"; + usleep(10000); + for (auto& it : channels_) { + LOG(ERROR) << "channel service config:" + << it.second->GetServiceConfigJSON(); + LOG(ERROR) << "channel lb config:" + << it.second->GetLoadBalancingPolicyName(); + } + Wait(); + + for (auto& it : channels_) { + LOG(ERROR) << "channel service config:" + << it.second->GetServiceConfigJSON(); + LOG(ERROR) << "channel lb config:" + << it.second->GetLoadBalancingPolicyName(); + } + cq_.Shutdown(); + for (auto& it : channels_) { + LOG(ERROR) << "channel service config:" + << it.second->GetServiceConfigJSON(); + LOG(ERROR) << "channel lb config:" + << it.second->GetLoadBalancingPolicyName(); + } + { std::lock_guard guard(chan_mutex_); for (auto& it : channels_) { @@ -53,6 +78,7 @@ GRPCClient::~GRPCClient() { } channels_.clear(); } + client_thread_->join(); } -- GitLab