Fix race condition for harvester Start / Stop in registry#4314
Merged
exekias merged 1 commit intoelastic:masterfrom May 15, 2017
Merged
Fix race condition for harvester Start / Stop in registry#4314exekias merged 1 commit intoelastic:masterfrom
exekias merged 1 commit intoelastic:masterfrom
Conversation
exekias
suggested changes
May 15, 2017
Contributor
exekias
left a comment
There was a problem hiding this comment.
Did some comments, let me know what do you think
filebeat/harvester/registry.go
Outdated
Contributor
There was a problem hiding this comment.
You are no longer using add function, I would either use it or remove it
filebeat/harvester/registry.go
Outdated
Contributor
There was a problem hiding this comment.
Having that you already have a lock in place done could be just a boolean isn't it? not against this approach though
Contributor
Author
There was a problem hiding this comment.
Agree, it could be also a bool. I would like to keep it that way as it has become quite a common pattern across our code base.
It was possible that with reloading enabled that during the shutdown of filebeat, a new harvester was started. This is now prevent by having a lock on the starting of the harvester so no new harvesters can be started when shutdown started. This is not backported to 5.x because it can only happen on shutdown and does not have any side affects. Closes elastic#3779
exekias
approved these changes
May 15, 2017
This was referenced May 15, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It was possible that with reloading enabled that during the shutdown of filebeat, a new harvester was started. This is now prevent by having a lock on the starting of the harvester so no new harvesters can be started when shutdown started.
This is not backported to 5.x because it can only happen on shutdown and does not have any side affects.
Closes #3779