Skip to content

Commit

Permalink
Stop filebeat on error starting registrar (elastic#2868)
Browse files Browse the repository at this point in the history
Currently when there is an error during loading the state, filebeat 5.0 doesn't stop and just continues. The registrar loading in filebeat 5.x was already improved an additional validation was added. This PR only changes that if there is an error in loading states, filebeat is not started and a proper error is returned.
  • Loading branch information
ruflin authored and tsg committed Oct 27, 2016
1 parent dcf9fb3 commit 7b4af9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Template, add newest changes here

=== Beats version HEAD
https://github.com/elastic/beats/compare/v5.0.0-rc1...5.0[Check the HEAD diff]
https://github.com/elastic/beats/compare/v5.0.0...5.0[Check the HEAD diff]

==== Breaking changes

Expand Down Expand Up @@ -51,6 +51,7 @@ https://github.com/elastic/beats/compare/v5.0.0-rc1...5.0[Check the HEAD diff]
*Topbeat*

*Filebeat*
- Stop Filebeat on registrar loading error.

*Winlogbeat*

Expand Down
1 change: 1 addition & 0 deletions filebeat/beater/filebeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func (fb *Filebeat) Run(b *beat.Beat) error {
err = registrar.Start()
if err != nil {
logp.Err("Could not start registrar: %v", err)
return err
}
// Stopping registrar will write last state
defer registrar.Stop()
Expand Down

0 comments on commit 7b4af9d

Please sign in to comment.