-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Elastic Agent] Retry deamon reload during enroll #25590
Conversation
/package |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
/package |
Pinging @elastic/agent (Team:Agent) |
@blakerouse Can you review this, @michalpristas I've moved to the right board :) |
|
||
for i := 5; i >= 0; i-- { | ||
retry := false | ||
if errors.Is(err, fleetapi.ErrTooManyRequests) { |
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.
These errors don't seem to apply to daemon reloading.
func (c *enrollCmd) daemonReloadWithBackoff(ctx context.Context) error { | ||
err := c.daemonReload(ctx) | ||
signal := make(chan struct{}) | ||
backExp := backoff.NewExpBackoff(signal, 60*time.Second, 10*time.Minute) |
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.
Can we start with lower amounts? This seems rather large initial wait. Maybe lets do like 10 seconds to maximum of 1 minute?
This is a local daemon it should be quick to connect and communicate.
@@ -323,6 +323,24 @@ func (c *enrollCmd) prepareFleetTLS() error { | |||
return nil | |||
} | |||
|
|||
func (c *enrollCmd) daemonReloadWithBackoff(ctx context.Context) error { | |||
err := c.daemonReload(ctx) |
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.
If no error here then no reason to continue. Just return as it has been reloaded.
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.
Looks good. Thanks for the fixes.
[Elastic Agent] Retry deamon reload during enroll (elastic#25590)
[Elastic Agent] Retry deamon reload during enroll (elastic#25590)
What does this PR do?
Adds retry for daemon reload
Why is it important?
elastic/fleet-server#297
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.