-
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
Fix race on shared maps in global fields #6947
Conversation
da43b1b
to
96c30fa
Compare
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.
@@ -53,7 +53,8 @@ func newProcessorPipeline( | |||
localProcessors = makeClientProcessors(config) | |||
) | |||
|
|||
needsCopy := global.alwaysCopy || localProcessors != nil || global.processors != nil | |||
// needsCopy := global.alwaysCopy || localProcessors != nil || global.processors != nil | |||
needsCopy := true |
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.
This looks weird. Is the intention to always copy? Or can the needsCopy
value change to false in other parts of the code?
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.
oh, some leftover from testing. :(
* 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)
* 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)
* 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)
* 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)
* 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)
* 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)
On publish fields are added to an event in this order:
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.