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

[heartbeat][libbeat] Fix potential race in runner lists #28799

Closed
wants to merge 5 commits into from

Conversation

andrewvc
Copy link
Contributor

@andrewvc andrewvc commented Nov 3, 2021

Fixes #28518 most likely, it's one I haven't personally been able to repro. This makes the runner list synchronous, thus preventing rapid adds/removes from creating simultaneously live plugins of the same type.

There's definitely ways to do this more concurrently, but that sort of optimization/complexity isn't warranted here. Heartbeat can tear down monitors near instantaneously.

Should be tested by setting up, starting, and stopping elastic agent

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.

Fixes elastic#28518 most likely, it's one I haven't personally been able to
repro. This makes the runner list synchronous, thus preventing rapid
adds/removes from creating simultaneously live plugins of the same type.

There's definitely ways to do this more concurrently, but that sort of
optimization/complexity isn't warranted here. Heartbeat can tear down
monitors near instantaneously.
@andrewvc andrewvc added bug Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team v7.16.0 backport-v7.16.0 Automated backport with mergify labels Nov 3, 2021
@andrewvc andrewvc requested a review from justinkambic November 3, 2021 21:23
@andrewvc andrewvc self-assigned this Nov 3, 2021
@andrewvc andrewvc requested a review from a team as a code owner November 3, 2021 21:23
@elasticmachine
Copy link
Collaborator

Pinging @elastic/uptime (Team:Uptime)

@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 Nov 3, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 3, 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 preview

Expand to view the summary

Build stats

  • Start Time: 2021-11-09T20:43:33.032+0000

  • Duration: 124 min 47 sec

  • Commit: 51e68f6

Test stats 🧪

Test Results
Failed 0
Passed 54199
Skipped 5345
Total 59544

💚 Flaky test report

Tests succeeded.

🤖 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.

@andrewvc
Copy link
Contributor Author

andrewvc commented Nov 9, 2021

@elasticmachine merge upstream

@andrewvc
Copy link
Contributor Author

andrewvc commented Nov 9, 2021

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Nov 9, 2021

update

✅ Branch has been successfully updated

Comment on lines 95 to 96
target := make(map[string]interface{})
m.Unpack(target)
Copy link
Contributor

Choose a reason for hiding this comment

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

we should create a small util for this, this is such a common use case .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's not really a great way to do this since go doesn't support generics (yet). If you have a proposal lmk though

@mergify
Copy link
Contributor

mergify bot commented Nov 9, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b sync-rl upstream/sync-rl
git merge upstream/master
git push upstream sync-rl

@jsoriano
Copy link
Member

/package

@andrewvc
Copy link
Contributor Author

andrewvc commented Dec 8, 2021

Closing for now, I think we've fixed the problems around ID conflicts in other PRs, and I'm a little worried about the more synchronous approach this takes in terms of creating new bugs.

@andrewvc andrewvc closed this Dec 8, 2021
@andrewvc andrewvc deleted the sync-rl branch February 9, 2022 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.16.0 Automated backport with mergify bug Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Heartbeat] Edited Synthetics Integration policies sometimes create duplicate monitor errors
5 participants