Skip to content

Commit

Permalink
set st to idle when block timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
lvpengcheng committed May 24, 2023
1 parent 334730e commit 9c2a4ee
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 9c2a4ee

Please sign in to comment.