Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
| log.Debug().Msgf("Listening on %s", addr) | ||
|
|
||
| go func(ctx context.Context, errChan chan error, ln net.Listener) { | ||
| if err := server.Serve(ln); err != nil && err != http.ErrServerClosed { |
There was a problem hiding this comment.
Should we do direct a direct comparison of the error (err != http.ErrServerClosed), or use the errors.Is() method?
There was a problem hiding this comment.
you mean replacing err != nil && err != http.ErrServerClosed with err != http.ErrServerClose?
if so you might end up with sending nil to a chan
| case <-forceCh: | ||
| log.Debug().Msg("go routine forced closed on exit") |
There was a problem hiding this comment.
I'm a bit confused what the purpose of forceCh and this message are, does this occur when the server closes with a non context.Cancelled error?
There was a problem hiding this comment.
yeah i'm not really sure why this is here. i understand it closes goroutine with main func but not sure why this was a problem and why this was not addressed with cancel contexts.
not touching this atm
Co-authored-by: Michel Laterman <82832767+michel-laterman@users.noreply.github.com>
|
This pull request is now in conflicts. Could you fix it @michalpristas? 🙏 |
Multiple endpoints
What is the problem this PR solves?
What this PR solves is a problem when agent got unenrolled on heavier load when agent managing fleet server cannot checkin to it's own server so it will fallback to unenroll.
Closes #741
How does this PR solve the problem?
Problem is solved by adding internal endpoint which is used for communication on local network (with agent handling fleet server)
It lets FS to spin up 2 set of handlers, one on public 8220 and one on port defined in config.
How to test this PR locally
This needs to be tested with work on
elastic-agentLink: elastic/beats#28993Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.