From 1d6ecd3c4e8c6ab24a9e80c2d60aef4adb25549e Mon Sep 17 00:00:00 2001 From: minqiyang Date: Mon, 2 Jul 2018 20:20:33 +0800 Subject: [PATCH] Change grpc version to 1.13.x --- cmake/external/grpc.cmake | 6 ++++-- paddle/fluid/operators/distributed/grpc_client.cc | 5 +++++ paddle/fluid/string/printf.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cmake/external/grpc.cmake b/cmake/external/grpc.cmake index 85f40585da2..e06c337254d 100644 --- a/cmake/external/grpc.cmake +++ b/cmake/external/grpc.cmake @@ -44,8 +44,10 @@ ExternalProject_Add( # 3. keep only zlib, cares, protobuf, boringssl under "third_party", # checkout and clean other dirs under third_party # 4. remove .git, and package the directory. - URL "http://paddlepaddledeps.bj.bcebos.com/grpc-v1.10.x.tar.gz" - URL_MD5 "1f268a2aff6759839dccd256adcc91cf" + #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" 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 8228a8c5a3e..c42f7e4326e 100644 --- a/paddle/fluid/operators/distributed/grpc_client.cc +++ b/paddle/fluid/operators/distributed/grpc_client.cc @@ -47,8 +47,11 @@ GRPCClient::~GRPCClient() { { std::lock_guard guard(chan_mutex_); for (auto& it : channels_) { + LOG(ERROR) << "channel ptr use count:" << it.second.use_count(); + LOG(ERROR) << "channel ptr use count:" << it.second.get(); it.second.reset(); } + channels_.clear(); } client_thread_->join(); } @@ -301,7 +304,9 @@ std::shared_ptr GRPCClient::GetChannel(const std::string& ep) { auto ch = grpc::CreateCustomChannel(ep, grpc::InsecureChannelCredentials(), args); + LOG(ERROR) << "get channel ep: " << ep << "count: " << ch.use_count(); channels_[ep] = ch; + LOG(ERROR) << "get channel ep: " << ep << "count: " << ch.use_count(); return ch; } diff --git a/paddle/fluid/string/printf.h b/paddle/fluid/string/printf.h index e0f62025068..062095a1c3e 100644 --- a/paddle/fluid/string/printf.h +++ b/paddle/fluid/string/printf.h @@ -84,7 +84,7 @@ void Fprintf(std::ostream& out, const char* fmt, const Args&... args) { } template -std::string Sprintf(const char* fmt = "", const Args&... args) { +std::string Sprintf(const char* fmt, const Args&... args) { std::ostringstream oss; Fprintf(oss, fmt, args...); return oss.str(); -- GitLab