未验证 提交 f5fd7c9d 编写于 作者: D Dong Daxiang 提交者: GitHub

Merge pull request #500 from barrierye/fix-client-warn

Fix Warning(Already thread initialized for stub) in client
......@@ -244,6 +244,7 @@ int PredictorClient::batch_predict(
res.Clear();
if (_predictor->inference(&req, &res) != 0) {
LOG(ERROR) << "failed call predictor with req: " << req.ShortDebugString();
_api.thrd_clear();
return -1;
} else {
client_infer_end = timeline.TimeStampUS();
......
......@@ -133,7 +133,10 @@ int StubImpl<T, C, R, I, O>::initialize(const VariantInfo& var,
template <typename T, typename C, typename R, typename I, typename O>
int StubImpl<T, C, R, I, O>::thrd_initialize() {
if (THREAD_GETSPECIFIC(_bthread_key) != NULL) {
LOG(WARNING) << "Already thread initialized for stub";
// Because gPRC is uesd, this function may be called
// multiple times, so the warning will be commented out
// temporarily. See PR:#483 and PR:#500 for details.
// LOG(WARNING) << "Already thread initialized for stub";
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册