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

Exponential backoff for SPIKE Keepers' contribution endpoints #69

Open
v0lkan opened this issue Dec 31, 2024 · 0 comments
Open

Exponential backoff for SPIKE Keepers' contribution endpoints #69

v0lkan opened this issue Dec 31, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@v0lkan
Copy link
Contributor

v0lkan commented Dec 31, 2024

This is how SPIKE keepers send their contribution

      _, err = net.Post(client, contributeUrl, md)
      for err != nil {
      time.Sleep(5 * time.Second)
      _, err = net.Post(client, contributeUrl, md)
      if err != nil {
      log.Log().Info("contribute",
      "msg", "Error sending contribution. Will retry",
      "err", err,
      )
      time.Sleep(5 * time.Second)
      }
      }

while this retry logic works, it is better to exponentially back off so that during a network partition we can give time for the system to breathe and recover.

There are examples of exponential backoff in the source code.

The point of this issue is to align with those examples, rather than implementing a backoff algorithm from scratch.

@v0lkan v0lkan added enhancement New feature or request good first issue Good for newcomers labels Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant