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

[WIP] Restructure Harvester and Prospector Shutdown #3538

Closed
wants to merge 2 commits into from

Conversation

ruflin
Copy link
Member

@ruflin ruflin commented Feb 6, 2017

There are two options for stopping a harvester or a prospector. Either the harvester and prospector finish sending all events and stop themself or they are killed because the output is blocking.

In case of shutting down filebeat without using shutdown_timeout filebeat is expected to shut down as fast as possible. This means channels are directly closed and the events are not passed through to the registry.

In case of dynamic prospector reloading, prospectors and harvesters must be stopped properly as otherwise no new harvester for the same file can be started.

So far the following changes were made:

  • Introduce harvester tracking in prospector to better control / manage the harvesters
  • Use beatDone channel coming from the beat itself for direct shutdown as this channel is closed when the beat is stopped.
  • Introduce more done channels in prospector to make shutdown more fine grained
  • Add system tests to verify new behaviour

TODO

  • Make sure all events are drained from channel to not guarantee that state updates will be persisted.

@ruflin ruflin added discuss Issue needs further discussion. Filebeat Filebeat in progress Pull request is currently in progress. labels Feb 6, 2017
@ruflin ruflin changed the title Restructure Harvester and Prospector Shutdown [WIP] Restructure Harvester and Prospector Shutdown Feb 7, 2017
@ruflin ruflin force-pushed the track-harvesters branch 5 times, most recently from ef8fdde to a67641d Compare February 7, 2017 13:05
There are two options for stopping a harvester or a prospector. Either the harvester and prospector finish sending all events and stop themself or they are killed because the output is blocking.

In case of shutting down filebeat without using `shutdown_timeout` filebeat is expected to shut down as fast as possible. This means channels are directly closed and the events are not passed through to the registry.

In case of dynamic prospector reloading, prospectors and harvesters must be stopped properly as otherwise no new harvester for the same file can be started.

So far the following changes were made:

* Introduce harvester tracking in prospector to better control / manage the harvesters
* Use `beatDone` channel coming from the beat itself for direct shutdown as this channel is closed when the beat is stopped.
* Introduce more done channels in prospector to make shutdown more fine grained
* Add system tests to verify new behaviour

TODO
* Make sure all events are drained from channel to not guarantee that state updates will be persisted.
@ruflin
Copy link
Member Author

ruflin commented Feb 9, 2017

Closing in favor of #3563

@ruflin ruflin closed this Feb 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Issue needs further discussion. Filebeat Filebeat in progress Pull request is currently in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant