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

Re-consider the default of ExponentialBackOff::max_elapsed_time #39

Open
thomaseizinger opened this issue Mar 11, 2021 · 1 comment
Open

Comments

@thomaseizinger
Copy link

We've ran into a surprising behaviour where backoff didn't retry a failed Future even though the error was clearly mapped to backoff::Error::Transient.

After some digging, we discovered that the default value of max_elapsed_time is 15 minutes and in our case, the Future only failed several hours in. For context, our Future first establishes a websocket connection and then reads values from it in a loop. This connection can fail at any time in which case we would like to re-establish the connection (but only if it failed for certain reasons), hence our use of backoff.

I would like to suggest to either remove max_elapsed_time entirely or at least set it to None by default. It is very surprising behaviour that the total runtime of a Future influences whether or not it will actually be retried once it completes with an error.

Thoughts?

@let4be
Copy link

let4be commented Jun 7, 2021

-exactly- the same problem!
@thomaseizinger thanks so much! probably saved me half day worth of digging :)

Default value for max_elapsed_time definitely should be None

let4be added a commit to let4be/crusty that referenced this issue Jun 7, 2021
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

2 participants