honeycombio / libhoney-rb

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

Client#close does not claim queue #8

Closed ryanking closed 7 years ago

ryanking commented 7 years ago

Example says:

# Call close to flush any pending calls to Honeycomb

Yet the drain param on the #close method defaults to false, which means that when we get here the queue will not be drained but discarded.

So, if you follow the example you have a race condidtion.

I would suggest that either #drain should default to true or there should be a separate method for draining vs closing.

ryanking commented 7 years ago

I would have opened a PR but not sure your preference on the semantic change.

ryanking commented 7 years ago

Not that this is not a hypothetical problem (if you follow the example, which I did). See here where I deployed my workaround:

screen shot 2017-04-08 at 9 25 49 pm

Pretty clear that I was losing data.

toshok commented 7 years ago

should be fixed (defaulting to drain=true as you suggested). Thanks for the report!