未验证 提交 c0f94aef 编写于 作者: T tangwei12 提交者: GitHub

fix bug with heart beat , test=develop (#20658)

上级 194f3dcf
...@@ -84,14 +84,7 @@ class HeartBeatMonitor { ...@@ -84,14 +84,7 @@ class HeartBeatMonitor {
be_monitored_var); be_monitored_var);
} }
static HeartBeatMonitor* GetInstance() { static HeartBeatMonitor* GetInstance() { return monitor_.get(); }
if (monitor_ == nullptr) {
PADDLE_THROW(
"HeartBeatMonitor is not inited, call "
"HeartBeatMonitor::Init first");
}
return monitor_.get();
}
void Stop() { void Stop() {
running_ = false; running_ = false;
......
...@@ -53,7 +53,11 @@ bool RequestSendHandler::Handle(const std::string& varname, ...@@ -53,7 +53,11 @@ bool RequestSendHandler::Handle(const std::string& varname,
rpc_server_->IncreaseBatchBarrier(kRequestSend); rpc_server_->IncreaseBatchBarrier(kRequestSend);
} else if (varname == COMPLETE_MESSAGE) { } else if (varname == COMPLETE_MESSAGE) {
VLOG(3) << "sync: recv complete message"; VLOG(3) << "sync: recv complete message";
HeartBeatMonitor::GetInstance()->Update(trainer_id, "", COMPLETED);
if (HeartBeatMonitor::GetInstance() != nullptr) {
HeartBeatMonitor::GetInstance()->Update(trainer_id, "", COMPLETED);
}
rpc_server_->Complete(); rpc_server_->Complete();
} else { } else {
// Async // Async
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册