Skip to content

Commit

Permalink
Fix retry dithering call
Browse files Browse the repository at this point in the history
Commit e5d0b89 added dithering to
the retry timeout, but introduced a bug: the base time gets included
twice in the calculation, leading to double the intended timeout. This
patch fixes that issue.
  • Loading branch information
tbachman committed Jun 22, 2023
1 parent ca67191 commit d91a6a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libopflex/engine/Processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ void Processor::sendToRole(const item& i, uint64_t& newexp,
(uint64_t)std::pow(2, i.details->retry_count) * retryDelay;

// Randomize the backoff by plus or minus ten percent
nextRetryDelay += ditherBackoff(nextRetryDelay, 10);
nextRetryDelay = ditherBackoff(nextRetryDelay, 10);

if (nextRetryDelay > policyRefTimerDuration)
nextRetryDelay = policyRefTimerDuration;
Expand Down

0 comments on commit d91a6a3

Please sign in to comment.