-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
logstash testing #927
logstash testing #927
Conversation
Sorry for big PR. changes in this PR are mostly focused on adding unit tests to output modes and logstash client. All other changes are due to fixes and and refactorings to create unit tests.
|
for comparison: |
if err != nil { | ||
return nil, err | ||
} | ||
// dataBuf.ReadFrom(streambuf.NewFixed(tmp)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to remove this commented out code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, can be removed. thanks
Looks good! |
c1384f1
to
676d1bd
Compare
- simplify worker loop only reconnecting on failure - re-use backoff state between multiple calls/messages - Enforce reconnect if sendloop returned
By returning the io error to the output mode, the mode can apply some backoff between multiple failures + number of send attempts gets increased more correctly. This way, even if timeout is 'transient', error handling strategy implemented by output modes is still in place.
simplify error handling in logstash client and always enforce a reconnect on failure
add more tests + potential fixes to logstash output mode