-
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
Panic 'fatal error: concurrent map iteration and map write' autodiscover and processor. #8040
Comments
Note: |
I've run this weekend a stress test with Filebeat and only the The code changed recently with the addition of netinfo in #6878 |
I will keep it running with the race detector to see if I catch the offending goroutine. theory so far is the way filebeat is structured with the outlet and the cache data structure inside the processors is problematic. |
running 6.3.1 and getting the same error as well. pulled code and rebuild with -race, getting the following race condition on 6.3.1 and 6.4.0
contents of filebeat.yml
|
Thank you for the trace. Which version did you create the last trace with? The Lines between both versions will be different, but I think I found it. Skimming the trace, the bug seems to be most likely due to add_host_metadata. Updating
|
Awesome for the trace I will make a patch ASAP
On Sat, Sep 1, 2018 at 3:36 PM Steffen Siering ***@***.***> wrote:
Thank you for the trace.
Which version did you create the last trace with? The Lines between both
versions will be different, but I think I found it.
Skimming the trace, the bug seems to be most likely due to
add_host_metadata. add_host_metadata adds a dictionary to the host field.
The dictionary which is shared (by reference) between a many events. The
host.name field (added with beats 6.3) is some global meta-data which
overwrites and updates the host document. Beats add global meta-data at
the end of any processing. Due to the host document being a shared
instance, we see a race condition when it is serialized in an older event,
while a new event is actively processed.
Updating Run
<https://github.com/elastic/beats/blob/master/libbeat/processors/add_host_metadata/add_host_metadata.go#L71>
in the add_host_metadata processor should fix this race condition:
func (p *addHostMetadata) Run(event *beat.Event) (*beat.Event, error) {
p.loadData()
event.Fields.DeepUpdate(p.data.Clone())
return event, nil
}
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8040 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAACgAxGqkf57xIE5S9lquHlK9oWnb9Fks5uWuGkgaJpZM4WGYeI>
.
--
ph
|
Fix a race between updating the host data structure and the serialization of events to json. closes elastic#8040
Fix a race between updating the host data structure and the serialization of events to json. closes #8040
Fix a race between updating the host data structure and the serialization of events to json. closes elastic#8040 (cherry picked from commit 415715d)
Fix a race between updating the host data structure and the serialization of events to json. closes elastic#8040 (cherry picked from commit 415715d)
Fix a race between updating the host data structure and the serialization of events to json. closes elastic#8040 (cherry picked from commit 415715d)
…st_metadata processor (elastic#8237) Fix a race between updating the host data structure and the serialization of events to json. closes elastic#8040 (cherry picked from commit b497720)
…) (elastic#8225) Fix a race between updating the host data structure and the serialization of events to json. closes elastic#8040 (cherry picked from commit b497720)
Created from: https://discuss.elastic.co/t/filebeat-autodiscover-gives-fatal-error-concurrent-map-iteration-and-map-write/145296
This look like we are not copying a shared data structure and this make the code panic with a concurrent error.
The text was updated successfully, but these errors were encountered: