Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds an optional retry when attempting to fetch a secret. When retrying there is a small delay implemented, which is also a parameter available to the user.
This was motivated by flows failing after trying to fetch a secret, knowing that they are present in the secret store. The hope is that a retry will help alleviate the issue of flows failing when there are intermediate connectivity issues.
Changes
This will add two new parameters to
Secret.get()
;retries
anddelay
.retries
is an optionalint
that specifies the number of retries to attempt before raising an issue. The default is 0, meaning there will be no retries and if it fails to fetch the secret for any reason, it will raise an exception. It's worth noting that we only retry on backend fetches of secrets.delay
is an optionalUnion[float, int]
that specifies the amount of time, in seconds, we should wait before attempting to retry theSecret.get()
operation. The default is0.5
currently, but this can be set by the user. Again, this only happens when we are using the backend secret store.Importance
Sometimes intermediate connection errors happen, we should be able to retry when they do.
Checklist
This PR:
changes/
directory (if appropriate)docs/outline.toml
for API reference docs (if appropriate)