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 #8653 to 6.4: Fix a race condition on add_host_metadata #8677

Merged
merged 1 commit into from
Oct 23, 2018

Conversation

jsoriano
Copy link
Member

Cherry-pick of PR #8653 to 6.4 branch. Original message:

Not sure if adding a mutex at this level will be too blocking for events processing, I have also though on other options to reduce contention on reads:

  • Using a RWLock, but we'd still need to write-lock first to check expiration and update
  • Using a RWLock and a go-routine to do periodic updates, but afaik we wouldn't have a way to stop it if the processor is removed.

Continues with #8223

Copy link
Contributor

@sayden sayden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor question

@@ -29,6 +29,21 @@ https://github.com/elastic/beats/compare/v6.4.1...6.4[Check the HEAD diff]

*Affecting all Beats*

- Fixed `add_host_metadata` not initializing correctly on Windows. {issue}7715[7715]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this lines added. Is it correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it is not correct :) thanks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

add_host_metadata keeps a cache of the host data collected, this cache
is now updated atomically.

(cherry picked from commit 74b9c6c)
Copy link
Contributor

@sayden sayden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jsoriano jsoriano merged commit 15ab04d into elastic:6.4 Oct 23, 2018
@jsoriano jsoriano deleted the backport_8653_6.4 branch October 23, 2018 14:59
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
add_host_metadata keeps a cache of the host data collected, this cache
is now updated atomically.

(cherry picked from commit 6d25fd9)
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