Skip to content

Prevent two beat instances with same data path from running concurrently#14069

Merged
ycombinator merged 2 commits intoelastic:masterfrom
ycombinator:libbeat-lock
Oct 17, 2019
Merged

Prevent two beat instances with same data path from running concurrently#14069
ycombinator merged 2 commits intoelastic:masterfrom
ycombinator:libbeat-lock

Conversation

@ycombinator
Copy link
Copy Markdown
Contributor

@ycombinator ycombinator commented Oct 15, 2019

This PR replaces #14030 per the discussion in #14030 (comment).

Currently it's possible for two concurrently-running Beat instances to share the same data path. This can lead to issues such as #2951.

This PR implements a lock for a Beat's data path. When a Beat instance start's up, it will try to acquire a lock on the data path by creating a lock file in it. If a lock file already exists, the Beat will not be allowed to start up and an error will be emitted in the logs. When the Beat instance is stopped, the lock file is removed.

@ycombinator
Copy link
Copy Markdown
Contributor Author

@urso This PR is ready for your review, whenever you get a chance. Thank you!

@ycombinator
Copy link
Copy Markdown
Contributor Author

jenkins, test this

@ycombinator
Copy link
Copy Markdown
Contributor Author

ycombinator commented Oct 17, 2019

Travis CI is passing. Jenkins CI is failing on a known flaky test: #13947.

@ycombinator
Copy link
Copy Markdown
Contributor Author

jenkins, test this

@ycombinator ycombinator merged commit d8b23cf into elastic:master Oct 17, 2019
@ycombinator ycombinator added v7.6.0 needs_backport PR is waiting to be backported to other branches. labels Oct 17, 2019
@ycombinator ycombinator deleted the libbeat-lock branch October 17, 2019 19:36
@ycombinator ycombinator removed the needs_backport PR is waiting to be backported to other branches. label Jan 15, 2020
jorgemarey pushed a commit to jorgemarey/beats that referenced this pull request Jun 8, 2020
…tly (elastic#14069)

* Lock data path while running beat instance

* Adding test
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