Skip to content

Commit

Permalink
fix: extend the batch timeout
Browse files Browse the repository at this point in the history
This mitigates #858, which shows that on Github, this timeout is nto large enough.
We also suspect this may alleviate issues encountered in Sui, e.g. failures in the
Sui reconfiguration end_to_end test.
  • Loading branch information
huitseeker committed Aug 30, 2022
1 parent 925fd7d commit 2549521
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion primary/src/block_waiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ use types::{
};
use Result::*;

const BATCH_RETRIEVE_TIMEOUT: Duration = Duration::from_secs(1);
//TODO [860]: customize the configuration of the block waiter to allow distinct
// settings for NW block waiter settings when deployed in different contexts.
// Indeed, this is used for NW + external consensus in the validator API (where
// latency is key) as well as NW + internal consensus, in the Executor
// (see #738, there reliability is key).
const BATCH_RETRIEVE_TIMEOUT: Duration = Duration::from_secs(10);

#[cfg(test)]
#[path = "tests/block_waiter_tests.rs"]
Expand Down
4 changes: 3 additions & 1 deletion primary/src/tests/block_waiter_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::{
block_synchronizer::{handler, handler::MockHandler},
block_waiter::{
BatchResult, BlockError, BlockErrorKind, BlockResult, GetBlockResponse, GetBlocksResponse,
BATCH_RETRIEVE_TIMEOUT,
},
BlockCommand, BlockWaiter, PrimaryWorkerMessage,
};
Expand Down Expand Up @@ -536,7 +537,8 @@ async fn test_batch_timeout() {
.unwrap();

// THEN we should expect to get back the result
let timer = sleep(Duration::from_millis(5_000));
// TODO: make sure we can run this test in less than the actual timeout range
let timer = sleep(BATCH_RETRIEVE_TIMEOUT + Duration::from_secs(2));
tokio::pin!(timer);

tokio::select! {
Expand Down

0 comments on commit 2549521

Please sign in to comment.