-
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
Autodiscover memleak #41748
Autodiscover memleak #41748
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
This is tested in a production environment and the leak seems completely resolved :) |
/test |
Is there anything holding this up? |
@rsafonseca Thanks for the fix! Could you please resolve the conflicts in the changelog? This will be the last input we need from you before merging. |
done @mauri870 :) |
Enabled auto-merge. Thanks again! |
/test |
run docs-build |
* Create a clone to release source struct from mem * Cleanup meta on stop events * Add changelog entry --------- Co-authored-by: Mauri de Souza Meneguzzo <[email protected]> (cherry picked from commit bb5032e)
* Create a clone to release source struct from mem * Cleanup meta on stop events * Add changelog entry --------- Co-authored-by: Mauri de Souza Meneguzzo <[email protected]> (cherry picked from commit bb5032e) Co-authored-by: Rafael da Fonseca <[email protected]> Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
Proposed commit message
Fix memory leak in autodiscovery
Before this change, start events were never removed from memory due to a permanent reference to mapstr.Clone() object containing the full event
After this change, the event is freed from memory as soon as handle_start finishes, maintaining only the metadata of the even in memory
After a stop event, all existing references to the metadata of the stopped config are now removed from the autodiscover meta map
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Screenshots
Logs