-
Notifications
You must be signed in to change notification settings - Fork 9
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
teach evaluator to conditionally retry provider invocation #438
Conversation
providers can wrap an error with this type to indicate to the evaluator that they encountered a temporary error, allowing the evaluator to retry invoking the provider.
518e695
to
e36fe70
Compare
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.
so at a high level I'm wondering if this is kind of a footgun.
if a rotator gets halfway through a rotation, it'll need to have some way to understand the state it is in when it is next retried.
I don't think that we have a solution for that at the moment.
I wonder if instead of handling this in the evaluator we should just add a helper function that provider authors can use for retries.
provider.go
Outdated
// RetryableError indicates a temporary error was encountered by a provider. | ||
// Providers can wrap an error with this type to indicate to the evaluator that it may retry calling the provider. | ||
type RetryableError struct { | ||
Err error |
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.
nit: since we have Unwrap
, I'd make this field unexported
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.
also--let's add a factory for these
func Retryable(err error) RetryableError { return RetryableError{err} }
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.
When providers have access to managing creds they'll usually have the authority to overwrite whatever they find, so keeping intermediate state isn't as necessary like it would be if we tried to use the rotated credential to manage itself.
We sort of do have a helper available with the |
Yeah, this is what I'm thinking tbh. That allows us to sidestep questions of state, etc. |
Adds a
RetryableError
error that providers can return to opt into being retried by the evaluator when they encounter a temporary error (such as a timeout).Closes https://github.com/pulumi/pulumi-service/issues/25444