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

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

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