提交 a146727e 编写于 作者: N Niu Chong 提交者: Jinhui Yuan

fix(actor.cpp): never access regst after sending it to producer (#1531)



Former-commit-id: 5eaa334ae0f86c301cd3d03f4db82a21d03a40af
上级 6d6a6005
......@@ -325,8 +325,9 @@ void Actor::AsyncSendConsumedCtrlRegstMsgToProducer() {
CHECK_GE(reg_deq.size(), returned_regst_num);
for (size_t i = 0; i < returned_regst_num; ++i) {
Regst* regst = reg_deq.at(i);
AsyncSendMsg(ActorMsg::BuildRegstMsgToProducer(actor_id_, regst->producer_actor_id(), regst));
// must access regst before sending it to producer
regst_desc_ids.push_back(regst->regst_desc_id());
AsyncSendMsg(ActorMsg::BuildRegstMsgToProducer(actor_id_, regst->producer_actor_id(), regst));
}
});
naive_consumed_rs_.PopFrontRegsts(regst_desc_ids);
......@@ -431,8 +432,9 @@ void Actor::HandleConsumedNaiveDataRegstToProducer(std::function<bool(Regst*)> I
naive_consumed_rs_.ForEachFrontRegst([&](Regst* regst) {
if (regst->regst_desc()->regst_desc_type().has_data_regst_desc()) {
if (IsAllowedRegst(regst) == false) { return; }
AsyncSendRegstMsgToProducer(regst);
// must access regst before sending it to producer
regst_desc_ids.push_back(regst->regst_desc_id());
AsyncSendRegstMsgToProducer(regst);
}
});
naive_consumed_rs_.PopFrontRegsts(regst_desc_ids);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册