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

Fix issue with log_writer panic on line with all spaces #4910

Merged
merged 4 commits into from
Jun 12, 2024

Conversation

blakerouse
Copy link
Contributor

@blakerouse blakerouse commented Jun 11, 2024

What does this PR do?

Fixes an issue where the log_writer.go can panic in the case it hits a line that is all spaces that becomes empty.

Why is it important?

Should not panic and crash.

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/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

Related issues

@blakerouse blakerouse added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team backport-v8.14.0 labels Jun 11, 2024
@blakerouse blakerouse self-assigned this Jun 11, 2024
@blakerouse blakerouse requested a review from a team as a code owner June 11, 2024 20:32
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

Copy link
Contributor

@jlind23 jlind23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change.

Co-authored-by: Julien Lind <julien.lind@elastic.co>
@blakerouse blakerouse enabled auto-merge (squash) June 12, 2024 13:21
@blakerouse blakerouse merged commit 3df9f8b into elastic:main Jun 12, 2024
14 checks passed
mergify bot pushed a commit that referenced this pull request Jun 12, 2024
* Fix #4907.

* Add changelog.

* Apply suggestions from code review

Co-authored-by: Julien Lind <julien.lind@elastic.co>

---------

Co-authored-by: Julien Lind <julien.lind@elastic.co>
(cherry picked from commit 3df9f8b)
@blakerouse blakerouse deleted the fix-4907 branch June 12, 2024 17:45
blakerouse added a commit that referenced this pull request Jun 12, 2024
* Fix #4907.

* Add changelog.

* Apply suggestions from code review

Co-authored-by: Julien Lind <julien.lind@elastic.co>

---------

Co-authored-by: Julien Lind <julien.lind@elastic.co>
(cherry picked from commit 3df9f8b)

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-v8.14.0 Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crash when logging empty line
3 participants