microsoft/Multiverso

Server::Process_EndTrain overflow?

xdlxl opened this issue · 1 comments

xdlxl commented

void Server::Process_EndTrain(std::shared_ptr msg_pack)
{
MsgType msg_type;
MsgArrow arrow;
int src, dst;
msg_pack->GetHeaderInfo(&msg_type, &arrow, &src, &dst);
clocks_[src] = 1 << 31;
in this place ,clocks_ is vector,so after bit manipulation clocks_[src] will become INT_MIN;so after one worker end train,other workers will be hanging in config.max_delay >=0. Will this be a problem?

feiga commented

Yes. It should be a mistake. I think it is intending to assign a large enough number to the clock. Change 31 to 30 should be OK, although it's a little tricky. Thanks for reporting this.