Skip to content

Commit

Permalink
Merge pull request #401 from nanblpc/set-idle-when-block-timeout
Browse files Browse the repository at this point in the history
set st to idle when block timeout
  • Loading branch information
PFZheng committed May 31, 2023
2 parents 334730e + 9c2a4ee commit e32b78a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/braft/replicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ void Replicator::wait_for_caught_up(ReplicatorId id,
}

void* Replicator::_on_block_timedout_in_new_thread(void* arg) {
Replicator* r = NULL;
bthread_id_t id = { (uint64_t)arg };
if (bthread_id_lock(id, (void**)&r) != 0) {
return NULL;
}
r->_st.st = IDLE;
bthread_id_unlock(id);
Replicator::_continue_sending(arg, ETIMEDOUT);
return NULL;
}
Expand Down

0 comments on commit e32b78a

Please sign in to comment.