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

Cherry-pick #6947 to 6.3: Fix race on shared maps in global fields #7011

Merged
merged 1 commit into from
May 4, 2018

Conversation

urso
Copy link

@urso urso commented May 3, 2018

Cherry-pick of PR #6947 to 6.3 branch. Original message:

On publish fields are added to an event in this order:

  • local/global configured fields
  • dynamic fields
  • "beat" metadata

When merging the fields, shared structures must not be overwritten or
updated concurrently. This is enforced by cloning the original fields
structure before applying updates.

This adds missing Clone operations if configured fields add new
fields to the beat namespace or if dynamic fields are enabled.

The dynamic fields support has been changed to dynamically test if a clone is required or not.

* Fix race on shared maps in global fields

On publish fields are added to an event in this order:
- local/global configured fields
- dynamic fields
- "beat" metadata

When merging the fields, shared structures must not be overwritten or
updated concurrently. This is enforced by cloning the original fields
structure before applying updates.

This adds missing Clone operations if configured fields add new
fields to the `beat` namespace or if dynamic fields are enabled.

* Remove hard coded bool from testing

(cherry picked from commit ffa812b)
@ruflin ruflin merged commit ac4d3b2 into elastic:6.3 May 4, 2018
@urso urso deleted the backport_6947_6.3 branch February 19, 2019 18:53
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
* Fix race on shared maps in global fields

On publish fields are added to an event in this order:
- local/global configured fields
- dynamic fields
- "beat" metadata

When merging the fields, shared structures must not be overwritten or
updated concurrently. This is enforced by cloning the original fields
structure before applying updates.

This adds missing Clone operations if configured fields add new
fields to the `beat` namespace or if dynamic fields are enabled.

* Remove hard coded bool from testing

(cherry picked from commit 7166823)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants