Skip to content
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

Merged
merged 2 commits into from
Apr 27, 2021

Conversation

blakerouse
Copy link
Contributor

@blakerouse blakerouse commented Apr 23, 2021

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

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

@blakerouse blakerouse added Team:Elastic-Agent Label for the Agent team backport-v7.13.0 Automated backport with mergify backport-v7.14.0 Automated backport with mergify labels Apr 23, 2021
@blakerouse blakerouse self-assigned this Apr 23, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Apr 23, 2021
@blakerouse blakerouse changed the title [Elastic Agent] Cleanup log message for cleanupListener [Elastic Agent] Reduce log level for listener cleanup to debug Apr 23, 2021
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)))
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Apr 23, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #25274 updated

  • Start Time: 2021-04-23T14:18:30.222+0000

  • Duration: 125 min 6 sec

  • Commit: e328310

Test stats 🧪

Test Results
Failed 0
Passed 6788
Skipped 16
Total 6804

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 6788
Skipped 16
Total 6804

@blakerouse blakerouse merged commit 08b0159 into elastic:master Apr 27, 2021
@blakerouse blakerouse deleted the fix-25131 branch April 27, 2021 11:46
mergify bot pushed a commit that referenced this pull request Apr 27, 2021
* Cleanup log message for cleanupListener.

* Add changelog.

(cherry picked from commit 08b0159)
mergify bot pushed a commit that referenced this pull request Apr 27, 2021
* Cleanup log message for cleanupListener.

* Add changelog.

(cherry picked from commit 08b0159)
blakerouse added a commit that referenced this pull request Apr 27, 2021
… (#25332)

* Cleanup log message for cleanupListener.

* Add changelog.

(cherry picked from commit 08b0159)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
blakerouse added a commit that referenced this pull request Apr 27, 2021
… (#25331)

* Cleanup log message for cleanupListener.

* Add changelog.

(cherry picked from commit 08b0159)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.13.0 Automated backport with mergify backport-v7.14.0 Automated backport with mergify Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Elastic Agent] Enroll fleet-server, socket cannot be removed
3 participants