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

Add retries to fetching secrets #5946

Closed
wants to merge 4 commits into from

Conversation

cjmartian
Copy link

@cjmartian cjmartian commented Jun 27, 2022

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 and delay.

retries is an optional int 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 optional Union[float, int] that specifies the amount of time, in seconds, we should wait before attempting to retry the Secret.get() operation. The default is 0.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:

  • adds new tests (if appropriate)
  • adds a change file in the changes/ directory (if appropriate)
  • updates docstrings for any new functions or function arguments, including docs/outline.toml for API reference docs (if appropriate)

@cjmartian cjmartian requested a review from zanieb as a code owner June 27, 2022 21:50
@cjmartian
Copy link
Author

This was fixed elsewhere. Closing as requested here.

@cjmartian cjmartian closed this Jul 7, 2022
@cjmartian cjmartian deleted the secret-retries branch July 7, 2022 19:04
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

Successfully merging this pull request may close these issues.

1 participant