Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Merge branch 'devel' into task/parchard/KEP-900
Browse files Browse the repository at this point in the history
  • Loading branch information
paularchard committed Dec 14, 2018
2 parents 7440078 + 53a9fa0 commit 65884e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion pbft/pbft_failure_detector.cpp
Expand Up @@ -42,7 +42,12 @@ pbft_failure_detector::handle_timeout(boost::system::error_code /*ec*/)
if (this->completed_requests.count(this->ordered_requests.front()) == 0)
{
LOG(error) << "Failure detector detected unexecuted request " << this->ordered_requests.front() << '\n';
this->start_timer();
this->ordered_requests.pop_front();
if (this->ordered_requests.size() > 0)
{
this->start_timer();
}

this->io_context->post(std::bind(this->failure_handler));
return;
}
Expand Down
4 changes: 2 additions & 2 deletions pbft/test/pbft_failure_detector_test.cpp
Expand Up @@ -125,9 +125,9 @@ namespace
ASSERT_TRUE(this->failure_detected);
}

TEST_F(pbft_failure_detector_test, timeout_restarts_timer)
TEST_F(pbft_failure_detector_test, timeout_doesnt_restart_timer)
{
EXPECT_CALL(*(this->request_timer), expires_from_now(_)).Times(Exactly(2));
EXPECT_CALL(*(this->request_timer), expires_from_now(_)).Times(Exactly(1));
this->build_failure_detector();

this->failure_detector->request_seen(req_a);
Expand Down

0 comments on commit 65884e0

Please sign in to comment.