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

Improve error for when instance lock is already locked #33788

Merged
merged 8 commits into from
Nov 30, 2022

Conversation

AndersonQ
Copy link
Member

What does this PR do?

Improves the error message for when the instance lock is already locked by adding the lock path on the message.

Why is it important?

It makes understanding the error easier as it'll state exactly what is locked.

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.

How to test this PR locally

Have 2 filebeats running using the same path.data, the second should show the error that this PR improve

Related issues

Logs

Original log:

[elastic_agent][error] filebeat stderr: "Exiting: data path already locked by another beat. Please make sure that multiple beats are not sharing the same data path (path.data).\n"

@AndersonQ AndersonQ added enhancement 8.7-candidate backport-v8.5.0 Automated backport with mergify backport-v8.6.0 Automated backport with mergify labels Nov 23, 2022
@AndersonQ AndersonQ self-assigned this Nov 23, 2022
@AndersonQ AndersonQ requested a review from a team as a code owner November 23, 2022 10:30
@AndersonQ AndersonQ requested review from belimawr and rdner and removed request for a team November 23, 2022 10:30
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 23, 2022
@AndersonQ AndersonQ added the Team:Elastic-Agent Label for the Agent team label Nov 23, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Nov 23, 2022
@@ -111,8 +111,9 @@ func (lock *Locker) Lock() error {
}
// case: lock could not be obtained.
if !isLocked {

Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick

Suggested change

@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 23, 2022

💚 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 preview

Expand to view the summary

Build stats

  • Start Time: 2022-11-29T14:58:29.892+0000

  • Duration: 69 min 2 sec

Test stats 🧪

Test Results
Failed 0
Passed 24116
Skipped 1954
Total 26070

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@AndersonQ
Copy link
Member Author

/test

@AndersonQ
Copy link
Member Author

/test

@AndersonQ AndersonQ merged commit 451f75b into elastic:main Nov 30, 2022
mergify bot pushed a commit that referenced this pull request Nov 30, 2022
mergify bot pushed a commit that referenced this pull request Nov 30, 2022
AndersonQ added a commit that referenced this pull request Dec 1, 2022
(cherry picked from commit 451f75b)

Co-authored-by: Anderson Queiroz <anderson.queiroz@elastic.co>
AndersonQ added a commit that referenced this pull request Dec 2, 2022
(cherry picked from commit 451f75b)

Co-authored-by: Anderson Queiroz <anderson.queiroz@elastic.co>
@AndersonQ AndersonQ deleted the 1772-improve-log branch April 3, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.7-candidate backport-v8.5.0 Automated backport with mergify backport-v8.6.0 Automated backport with mergify enhancement Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants