Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Features/issue 769 #770

Closed

Conversation

michaelgibson
Copy link
Contributor

Adding http_timeout for http post in elasticsearch output for issue #769

@@ -647,7 +665,21 @@ func (h *HttpBulkIndexer) Index(body []byte) (success bool, err error) {
return false, err
} else {
request.Header.Add("Accept", "application/json")
response, err := h.client.Do(request)
response, err := h.clientConn.Do(request)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that the SetDeadline() calls should be happening immediately before this clientConn.Do() call. The first time through it's not so bad, but for subsequent requests the deadline is set before returning from this function. Theoretically we could end up burning through our timeout interval before the next call to Index() even happens.

@rafrombrc
Copy link
Contributor

Also, the commit history on this PR is a bit whack. I'd be very grateful if you could fix it up so there aren't any extraneous commits attached to it, ideally just a single commit that reflects the diff btn dev and your branch. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants