-
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 in monitoring output #8646
Conversation
The action part of the bulk request used to be a constant (used to use 'var' for init purposes only), but with 6.4 we have had to introduce the `index._type` field per monitoring type. With the introduction of telemetry we ended up with 2 publisher pipelines and 2 outputs, each with slightly different parameters, yet the action part has become a 'global' shared variable, that was modified by each reporter. If metrics and telemetry publish events at the same time, there is a race in modifying the global and serializing the bulk request. This change removes the global and creates an action item per event, such that there will be no sharing at all.
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.
LGTM, good catch.
We have fixed a few issues recently with shared map or values, I will pay more attention in reviews for that specific case. With the addition of more processors with caching in beats we have to take extra care.
make check is failing on that PR. |
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.
Failure is legit.
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.
Code LGTM but probably a naming conflict?
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.
WFG
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.
Thanks for the changelog, forgot about it.
The action part of the bulk request used to be a constant (used to use 'var' for init purposes only), but with 6.4 we have had to introduce the `index._type` field per monitoring type. With the introduction of telemetry we ended up with 2 publisher pipelines and 2 outputs, each with slightly different parameters, yet the action part has become a 'global' shared variable, that was modified by each reporter. If metrics and telemetry publish events at the same time, there is a race in modifying the global and serializing the bulk request. This change removes the global and creates an action item per event, such that there will be no sharing at all. (cherry picked from commit 1438000)
The action part of the bulk request used to be a constant (used to use 'var' for init purposes only), but with 6.4 we have had to introduce the `index._type` field per monitoring type. With the introduction of telemetry we ended up with 2 publisher pipelines and 2 outputs, each with slightly different parameters, yet the action part has become a 'global' shared variable, that was modified by each reporter. If metrics and telemetry publish events at the same time, there is a race in modifying the global and serializing the bulk request. This change removes the global and creates an action item per event, such that there will be no sharing at all. (cherry picked from commit 1438000)
Cherry-pick of PR #8646 to 6.x branch. Original message: The action part of the bulk request used to be a constant (used to use 'var' for init purposes only), but with 6.4 we have had to introduce the `index._type` field per monitoring type. With the introduction of telemetry we ended up with 2 publisher pipelines and 2 outputs, each with slightly different parameters, yet the action part has become a 'global' shared variable, that was modified by each reporter. If metrics and telemetry publish events at the same time, there is a race in modifying the global and serializing the bulk request. This change removes the global and creates an action item per event, such that there will be no sharing at all.
Cherry-pick of PR #8646 to 6.4 branch. Original message: The action part of the bulk request used to be a constant (used to use 'var' for init purposes only), but with 6.4 we have had to introduce the `index._type` field per monitoring type. With the introduction of telemetry we ended up with 2 publisher pipelines and 2 outputs, each with slightly different parameters, yet the action part has become a 'global' shared variable, that was modified by each reporter. If metrics and telemetry publish events at the same time, there is a race in modifying the global and serializing the bulk request. This change removes the global and creates an action item per event, such that there will be no sharing at all.
…ic#8659) Cherry-pick of PR elastic#8646 to 6.4 branch. Original message: The action part of the bulk request used to be a constant (used to use 'var' for init purposes only), but with 6.4 we have had to introduce the `index._type` field per monitoring type. With the introduction of telemetry we ended up with 2 publisher pipelines and 2 outputs, each with slightly different parameters, yet the action part has become a 'global' shared variable, that was modified by each reporter. If metrics and telemetry publish events at the same time, there is a race in modifying the global and serializing the bulk request. This change removes the global and creates an action item per event, such that there will be no sharing at all.
The action part of the bulk request used to be a constant (used to use
'var' for init purposes only), but with 6.4 we have had to introduce the
index._type
field per monitoring type.With the introduction of telemetry we ended up with 2 publisher
pipelines and 2 outputs, each with slightly different parameters, yet
the action part has become a 'global' shared variable, that was modified
by each reporter. If metrics and telemetry publish events at the same
time, there is a race in modifying the global and serializing the bulk
request.
This change removes the global and creates an action item per event,
such that there will be no sharing at all.