Skip to content

Commit

Permalink
Cap repair requests timeout (#958)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakridge authored Aug 23, 2018
1 parent 0c8eec2 commit 6147e54
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ fn repair_window(
}
*last = consumed;
*times += 1;

// Experiment with capping repair request duration.
// Once nodes are too far behind they can spend many
// seconds without asking for repair
if *times > 128 {
*times = 65;
}

//if times flips from all 1s 7 -> 8, 15 -> 16, we retry otherwise return Ok
if *times & (*times - 1) != 0 {
trace!("repair_window counter {} {} {}", *times, consumed, received);
Expand Down

0 comments on commit 6147e54

Please sign in to comment.