-
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] Reduce log level for listener cleanup to debug #25274
Conversation
Pinging @elastic/agent (Team:Agent) |
if err := os.Remove(path); err != nil { | ||
log.Errorf("%s", errors.New(err, fmt.Sprintf("Failed to cleanup %s", path), errors.TypeFilesystem, errors.M("path", path))) | ||
if err := os.Remove(path); err != nil && !os.IsNotExist(err) { | ||
log.Debug("%s", errors.New(err, fmt.Sprintf("Failed to cleanup %s", path), errors.TypeFilesystem, errors.M("path", path))) |
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.
In which scenarios does the file not exists so the cleanup fails?
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 believe the case is when the temp directory is removed before the actually socket. So that cause it to fail on the removal.
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.
But what removes the temp directory? BTW, don't want to block this PR on this but would be good to understand why it happens.
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
* Cleanup log message for cleanupListener. * Add changelog. (cherry picked from commit 08b0159)
* Cleanup log message for cleanupListener. * Add changelog. (cherry picked from commit 08b0159)
What does this PR do?
Cleans up the log message when removing the listener socket fails.
Why is it important?
So its not reported or confusing to users, its okay if it fails.
Checklist
[ ] I have made corresponding change to the default configuration files[ ] I have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues