Skip to content

Fix race condition for harvester Start / Stop in registry#4314

Merged
exekias merged 1 commit intoelastic:masterfrom
ruflin:fix-registry-race
May 15, 2017
Merged

Fix race condition for harvester Start / Stop in registry#4314
exekias merged 1 commit intoelastic:masterfrom
ruflin:fix-registry-race

Conversation

@ruflin
Copy link
Copy Markdown
Contributor

@ruflin ruflin commented May 15, 2017

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

Copy link
Copy Markdown
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

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

Did some comments, let me know what do you think

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You are no longer using add function, I would either use it or remove it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the method.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Having that you already have a lock in place done could be just a boolean isn't it? not against this approach though

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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
@ruflin ruflin force-pushed the fix-registry-race branch from 011e7e4 to 0a51a68 Compare May 15, 2017 09:49
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