-
Notifications
You must be signed in to change notification settings - Fork 8
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: asynchronous providers #2055
Conversation
c.lastSyncAttempt = optional.Some(clock.Now()) | ||
err := c.provider.Sync(ctx, c.values) | ||
if err != nil { | ||
logger.Errorf(err, "Error syncing %s", c.provider.Key()) |
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.
This happens when a provider fails? eg asm timeout? Does the backoff time out?
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.
This happens when a provider fails to sync (such as ASM timing out, or 1Password not getting authorized).
The backoff schedules the sync to try again in a future round of async provider syncs, starting at 1s later, exponentially growing and then maxing out at a 2 min maximum (syncMaxBackoff
).
Does that answer your question @gak?
e82705f
to
40cc1df
Compare
0975745
to
32a0eaf
Compare
closes #1949
Changes:
Provider
interface into:SynchronousProvider
: same as old interface, can load values from the data source on-demandAsynchronousProvider
: used by providers that prefer to sync with their data sourceManager
owns acache
which syncs asynchronous providersManager
is getting values from an asynchronous provider, it now accesses it viacache
Manager
is setting values for an asynchronous provider, it directly sets it with the provider and then notifies the cacheOnePasswordProvider
is now anAsynchronousProvider
so that we don't cause multiple annoying authorization promptsASM
is now anAsynchronousProvider
with it's previoussecretsCache
now being repurposed to work more generally.