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

Autodiscover memleak #41748

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Ensure Elasticsearch output can always recover from network errors {pull}40794[40794]
- Add `translate_ldap_attribute` processor. {pull}41472[41472]
- Remove unnecessary debug logs during idle connection teardown {issue}40824[40824]
- Fix autodiscovery memory leak related to metadata of start events {pull}41748[41748]

*Auditbeat*

Expand Down
7 changes: 6 additions & 1 deletion libbeat/autodiscover/autodiscover.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ func (a *Autodiscover) handleStop(event bus.Event) bool {
updated = true
}

// Cleanup meta references for this eventID
for configHash := range a.configs[eventID] {
a.meta.Remove(configHash)
}

delete(a.configs, eventID)

return updated
Expand All @@ -300,7 +305,7 @@ func (a *Autodiscover) getMeta(event bus.Event) mapstr.M {
a.logger.Errorf("Got a wrong meta field for event %v", event)
return nil
}
return meta
return meta.Clone()
}

// getID returns the event "id" field string if present
Expand Down
Loading