Clever/leakybucket — pull request #4 by azylman (2014-06-27 18:52:22+00:00)
Title: redis: fix bug that can result in buckets w/o ttl

If a bucket expires in between the failed call to SETNXEX (failed
because the bucket exists) and the call to INCR, we could INCRBY an empty
bucket, resulting in a bucket that has no TTL and will never get a TTL.

INCRBY is atomic, so if the result of INCRBY is the same as the amount
to be incremented by (usually 1), we know with 100% certainty that we
just created a new bucket and should set the expiration on the bucket.