honeycombio / libhoney-rb

Ruby library for sending data to Honeycomb
Apache License 2.0
11 stars 30 forks source link

use faraday instead of http for requests #12

Closed igorwwwwwwwwwwwwwwwwwwww closed 7 years ago

igorwwwwwwwwwwwwwwwwwwww commented 7 years ago

for some set of large responses, the http gem was raising an error:

IOError: not opened for reading

i am not completely sure what the conditions for that failure are, but request body size seems to be correlated with this occurring consistently.

switching to faraday fixed the problem.

another thing worth noting is that this error was not being rescued anywhere, which made it quite difficult to spot. that is something that should be addressed regardless of this patch.

eanakashima commented 7 years ago

Just rolled a new release (1.1.0) with this in it. Thanks again.

igorwwwwwwwwwwwwwwwwwwww commented 7 years ago

It looks like this patch may have introduced a memory leak. From some testing, it looks like faraday makes use of timeout, which creates a thread per call. Some rudimentary memory profiling points to this as the source of un-freed memory. I am digging into this and will see if I can find out more about the strange error we saw with the http gem.

eanakashima commented 7 years ago

@igorwwwwwwwwwwwwwwwwwwww oof, thanks for the report. Let us know how it goes, and we'll take a look from our end to see if we can get some better behavior out of faraday.