-
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
[heartbeat][libbeat] Fix potential race in runner lists #28799
Conversation
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.
Pinging @elastic/uptime (Team:Uptime) |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
💚 Flaky test reportTests succeeded. 🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
@elasticmachine merge upstream |
@Mergifyio update |
✅ Branch has been successfully updated |
heartbeat/beater/heartbeat.go
Outdated
target := make(map[string]interface{}) | ||
m.Unpack(target) |
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.
we should create a small util for this, this is such a common use case .
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.
There's not really a great way to do this since go doesn't support generics (yet). If you have a proposal lmk though
This pull request is now in conflicts. Could you fix it? 🙏
|
/package |
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. |
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
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.