提交 1d6ecd3c 编写于 作者: M minqiyang

Change grpc version to 1.13.x

上级 adfaf9a6
...@@ -44,8 +44,10 @@ ExternalProject_Add( ...@@ -44,8 +44,10 @@ ExternalProject_Add(
# 3. keep only zlib, cares, protobuf, boringssl under "third_party", # 3. keep only zlib, cares, protobuf, boringssl under "third_party",
# checkout and clean other dirs under third_party # checkout and clean other dirs under third_party
# 4. remove .git, and package the directory. # 4. remove .git, and package the directory.
URL "http://paddlepaddledeps.bj.bcebos.com/grpc-v1.10.x.tar.gz" #URL "http://paddlepaddledeps.bj.bcebos.com/grpc-v1.10.x.tar.gz"
URL_MD5 "1f268a2aff6759839dccd256adcc91cf" URL "http://localhost:8000/grpc-v1.13.x.tar.gz"
#URL_MD5 "1f268a2aff6759839dccd256adcc91cf"
URL_MD5 "27019f520a32161396b319e57c24a5ac"
PREFIX ${GRPC_SOURCES_DIR} PREFIX ${GRPC_SOURCES_DIR}
UPDATE_COMMAND "" UPDATE_COMMAND ""
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
......
...@@ -47,8 +47,11 @@ GRPCClient::~GRPCClient() { ...@@ -47,8 +47,11 @@ GRPCClient::~GRPCClient() {
{ {
std::lock_guard<std::mutex> guard(chan_mutex_); std::lock_guard<std::mutex> guard(chan_mutex_);
for (auto& it : channels_) { 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(); it.second.reset();
} }
channels_.clear();
} }
client_thread_->join(); client_thread_->join();
} }
...@@ -301,7 +304,9 @@ std::shared_ptr<grpc::Channel> GRPCClient::GetChannel(const std::string& ep) { ...@@ -301,7 +304,9 @@ std::shared_ptr<grpc::Channel> GRPCClient::GetChannel(const std::string& ep) {
auto ch = auto ch =
grpc::CreateCustomChannel(ep, grpc::InsecureChannelCredentials(), args); grpc::CreateCustomChannel(ep, grpc::InsecureChannelCredentials(), args);
LOG(ERROR) << "get channel ep: " << ep << "count: " << ch.use_count();
channels_[ep] = ch; channels_[ep] = ch;
LOG(ERROR) << "get channel ep: " << ep << "count: " << ch.use_count();
return ch; return ch;
} }
......
...@@ -84,7 +84,7 @@ void Fprintf(std::ostream& out, const char* fmt, const Args&... args) { ...@@ -84,7 +84,7 @@ void Fprintf(std::ostream& out, const char* fmt, const Args&... args) {
} }
template <typename... Args> template <typename... Args>
std::string Sprintf(const char* fmt = "", const Args&... args) { std::string Sprintf(const char* fmt, const Args&... args) {
std::ostringstream oss; std::ostringstream oss;
Fprintf(oss, fmt, args...); Fprintf(oss, fmt, args...);
return oss.str(); return oss.str();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册