-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Handling invalid connections #102
Comments
There is currently no such way that I'm aware. The question is if this is really what you want -- it seems likely that many of these kinds of errors could be transient, so retrying them before timing out might actually be desirable. |
Yeah, I agree with you in general. In my case, we have a shell utility connecting to a db. If the user typos their db name then it takes 30s (the timeout) to return an error. I know logging with the error sink will help, but really, retrying is pointless. |
Maybe you should just set the timeout lower in your application? |
Well, that’s not the only problem. The other is that the error message just says timeout. Do you think bb8 should not have the concept of an exception that should not be retried on (is terminal for the get attempt and is exposed to the user)? |
That's a pretty abstract question, to which I don't have a concrete answer. I'm skeptical that there's a straightforward way to implement this that doesn't make things worse for other users and doesn't incur a whole bunch of complexity for what in my opinion is limited benefit. bb8 is chiefly intended for long-running (server) processes. Optimizing for startup doesn't necessarily make sense. You might just start a connection without bb8 to start with to validate the user's input. |
The simplest thing I could think of would be to add fn should_retry(err: &Self::Error) -> bool to The
I'm probably missing something, though. |
That seems fine to me, let's have a PR (please add some tests). |
I ran into an issue where |
I opened #104 to discuss the path forward. |
In #104 I suggest an alternative where the sink does not get the error in a catastrophe, which seems OK to me. |
If a user incorrectly specifies their connection setting (e.g. typos the IP address), then bb8's
get
method will hit errors and retry until the timeout. Is there a way of marking certain errors as "just give up"?The text was updated successfully, but these errors were encountered: