Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peer CFT Block Puller: total time duration of sleep does not reset #4394

Closed
Tracked by #4240
tock-ibm opened this issue Aug 23, 2023 · 0 comments
Closed
Tracked by #4240

Peer CFT Block Puller: total time duration of sleep does not reset #4394

tock-ibm opened this issue Aug 23, 2023 · 0 comments
Labels

Comments

@tock-ibm
Copy link
Contributor

Description

In internal/pkg/peer/blocksprovider/deliverer.go:150

Local variable totalDuration measures the total sleep during retries. If it exceeds reconnectTotalTimeThreshold the Deliverer may exit if MaxRetryDurationExceededHandler returns true.

However, it does not reset on success (block reception), so DeliverBlocks() may exit eventually if the cumulative sleep time is large, but no consecutive reconnect failure sequence exceeds the threshold for stopping retries.

totalDuration += sleepDuration
if totalDuration > d.MaxRetryDuration {
    if d.MaxRetryDurationExceededHandler() {
        d.Logger.Warningf("attempted to retry block delivery for more than peer.deliveryclient.reconnectTotalTimeThreshold        duration %v, giving up", d.MaxRetryDuration)
        return
    }
    d.Logger.Warningf("peer is a static leader, ignoring peer.deliveryclient.reconnectTotalTimeThreshold")
}

The solution is to reset totalDuration together when we reset failureCounter.

Steps to reproduce

Several bursts of failures, each burst followed by a success, each burst with duration < reconnectTotalTimeThreshold
With enough bursts, totalDuration will be > reconnectTotalTimeThreshold, and the Deliverer will give up, even tough it should not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant