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

Distinguish between permanent and transient errors when giving up on a backoff strategy #63

Open
sr-gi opened this issue Dec 20, 2022 · 0 comments

Comments

@sr-gi
Copy link

sr-gi commented Dec 20, 2022

It looks like there is no native way to check whether a strategy gave up due to reaching its end with no success (constantly hitting transient errors) and due to a permanent error.

This can be done depending on the returned error, but some variants may be used both as permanent or transient, meaning that the inner error may have to include whether it is transient or permanent. This adds a lot of boilerplate. e.g.

enum RetryError {
  // Permanent
  Y,
  Z,
  // Transient
  B, 
  C
  // Both (bool indicates whether this is permanent or transient)
  N(bool),
  M(bool),
}

TL;DR: It'd be great if retry and retry_notify could return a flag indicating whether it stopped due to an accumulation of transient errors or due to a permanent one.

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

No branches or pull requests

1 participant