HouseTrip/remote_lock — pull request #3 by mezis (2014-02-05 17:32:51+00:00)
Title: Fix persistent failure mode

Pheaw, this one was a bit hairy. [Redis transactions](http://redis.io/topics/transactions) are something else.

It fixes the "can't acquire lock" errors you've occasionally seen in Airbrake, and that would happen because a previous client aborted between `SETNX` and `EXPIRE`, thus leaving around locks that don't expire.

The hint was that it seemed to always be about the same IDs!

I've cleared such locks in our production database manually.

I'm not sure how to properly test this though, given the new implementation doesn't have the same issue at all. I've increased test coverage a tad to err on the side of caution.

@pedrocunha, @matthutchinson, @hubb I'd like your opinion!