-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Labels
area: popmThis is a change to popm (PoP Miner)This is a change to popm (PoP Miner)type: bugThis is a bugThis is a bug
Description
Confirmation
- I have checked for similar issues.
Describe the bug
PR #612 added logic for exponential backoff to popm. However, the method used (byte-shifting), will eventually force delay to overflow, leading to delay being set to a negative number (preventing Tick() from ever continuing) or even 0:
delay := baseDelay * (1 << attempt)
if delay > maxDelay {
delay = maxDelay
}
This is exacerbated by the jitter code, which will panic once the argument for Int64N() becomes too high:
jitter := int64(delay / 10)
delay += time.Duration(mathrand.Int64N(jitter*2) - jitter)
Expected behaviour
popm should retry indefinitely without any issues
Environment
Version:
Operating System:
Architecture:
Additional Information
No response
Metadata
Metadata
Assignees
Labels
area: popmThis is a change to popm (PoP Miner)This is a change to popm (PoP Miner)type: bugThis is a bugThis is a bug