-
Notifications
You must be signed in to change notification settings - Fork 323
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 refreshes and retries to server-acl-init job #3137
Conversation
ca04483
to
ea67e71
Compare
27ec9f7
to
fb5d03e
Compare
Add refreshes and retries to server-acl-init job
2a4cf3a
to
3ada3ff
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.
I'm not sure how I feel about the nest backoff/retry, but otherwise looks great! Thank you!
if err = backoff.Retry(func() error { | ||
ipAddrs, err = netaddrs.IPAddrs(c.ctx, c.consulFlags.Addresses, c.log) | ||
if err != nil { | ||
c.log.Error("Error resolving IP Address", "err", err) | ||
return err | ||
} | ||
c.log.Info("Refreshing server IP addresses", "addresses", ipAddrs) | ||
return nil | ||
}, exponentialBackoffWithMaxInterval()); err != nil { | ||
return nil, err | ||
} | ||
return ipAddrs, nil |
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.
Do we want the nested backoff/retry? There may be a case for resetting the parent loop, but it might be easier to reason about with one-level.
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.
I am not a fan of the style of it but we are using a similar retry style during the bootstrap (line 330) and I went with that for consistency.
…to release/1.2.x (#3251) Add refreshes and retries to server-acl-init job
…to release/1.1.x (#3252) Add refreshes and retries to server-acl-init job
Add refreshes and retries to server-acl-init job
Changes proposed in this PR:
How I've tested this PR:
How I expect reviewers to test this PR:
👀
Checklist: