diff --git a/cmake/external/grpc.cmake b/cmake/external/grpc.cmake index 85f40585da29bab9a107f5546e64870975f4c2d3..e06c337254d39ebc87fb6bbd9e6bcbd9bae18218 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 8228a8c5a3eae73fe82551c8aad55290b0d54ef0..c42f7e4326efd6c8ef153a3eab724516f4ee49fb 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 e0f6202506868fd0dcbe93297785682edbcfe792..062095a1c3e977c0bcc89346ead765acb023bcf7 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();