Skip to content

Commit

Permalink
Fix panic in log harvester error handling (elastic#6802)
Browse files Browse the repository at this point in the history
When the log harvester initialisation fails (i.e. due to wrong configuration),
it causes a panic instead of reporting the error.

Fixes elastic#6800
  • Loading branch information
adriansr authored and tsg committed Apr 9, 2018
1 parent c9cc4f6 commit 6c87377
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ https://github.com/elastic/beats/compare/v6.2.2...6.2[Check the HEAD diff]

*Filebeat*

- Fix panic when log prospector configuration fails to load. {issue}6800[6800]

*Heartbeat*

*Metricbeat*
Expand Down
4 changes: 3 additions & 1 deletion filebeat/prospector/log/prospector.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,9 @@ func (p *Prospector) createHarvester(state file.State, onTerminate func()) (*Har
},
outlet,
)
h.onTerminate = onTerminate
if err == nil {
h.onTerminate = onTerminate
}
return h, err
}

Expand Down

0 comments on commit 6c87377

Please sign in to comment.