hpcloud / tail

Go package for reading from continously updated files (tail -f)
MIT License
2.71k stars 503 forks source link

ratelimit: fix bucket collection eviction #105

Closed boz closed 7 years ago

boz commented 7 years ago

Two (all-too-easily) inverted checks are causing all undrained buckets to be evicted every on every bucket insert when there are more than 100 buckets. Drained buckets are never evicted.

I was reading the code and noticed it, but now I don't see ratelimiter.Memory used anywhere.

Testing this isn't pretty but I can do it if you'd like.

Nino-K commented 7 years ago

@boz Thanks for your contribution.