tdtran/resque-uniq — pull request #11 by jamonkko (2014-03-10 13:44:58+00:00)
Title: Fix parallel deletion of stale locks

Fix two race conditions (see https://github.com/tdtran/resque-uniq/issues/10)

Used Lua script for atomic operations that reset stale locks. I did consider using just Redis api to fix it, maybe with GETSET command or with MULTI transaction, but using either one seemed to make the implementation even more complex. So Lua script it was.

This change requires Redis 2.6 or newer because Lua scripting was added to 2.6.

If you merge this, it might be good to increase version to 0.1.X so that you can still support people using older Redis with 0.0.X releases if needed (although they would need another fix for the race condition corner cases that is compatible with older Redis if they have a setup that might get that problem)