-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat: more automatic retries #43
Conversation
e52d0aa
to
5081e83
Compare
}) | ||
.await | ||
.map_err(Error::Metadata)?; | ||
let mut backoff = Backoff::new(&self.backoff_config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially played around with extracting this retry logic so that it could be shared between here and the PartitionClient, but the different error types made this complicated and so I opted for the simple solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add a trait for the errors:
trait ErrorHandling {
fn should_invalidate_broker() -> bool;
}
impl ErrorHandling for RequestError {...}
...
If I understand the logic correctly this is all you currently need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to know what types of errors can be handled , which varies because they are different error enumerations...
I also experimented with just using a single error enumeration for all the clients, this actually works quite nicely but was a substantial amount of churn and I got fed up 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit worried that we have no real tests for this.
Created #49 to track improving the test coverage, I agree it should be tested |
Configures automatic handling of IO and Poisoned errors