Skip to content

Commit

Permalink
Merge pull request #944 from urso/fix/ls-err-loop
Browse files Browse the repository at this point in the history
Fix logstash output hanging on too many timeout errors
  • Loading branch information
tsg committed Feb 8, 2016
2 parents 08a6d2e + ee062e0 commit f126018
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ https://github.com/elastic/beats/compare/v1.1.0...master[Check the HEAD diff]
==== Bugfixes

*Affecting all Beats*
- Fix logstash output loop hanging in infinite loop on too many output errors.

*Packetbeat*

Expand Down
3 changes: 2 additions & 1 deletion libbeat/outputs/logstash/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ func (l *lumberjackClient) onFail(n int, err error) (int, error) {

// if we've seen 3 consecutive timeout errors, close connection
l.countTimeoutErr++
if l.countTimeoutErr == maxAllowedTimeoutErr {
if l.countTimeoutErr >= maxAllowedTimeoutErr {
l.countTimeoutErr = 0 // reset error counter and close connection
_ = l.Close()
return n, err
}
Expand Down

0 comments on commit f126018

Please sign in to comment.