HouseTrip/remote_lock — pull request #2 by arobecke (2013-12-17 15:56:47+00:00)
Title: Require locks as long as expiry is not yet reached. 

This removes the randomness in waiting until trying to acquire a lock. the new code now retries to acquire a lock as long as the expiry time has not been reached yet and breaks when it is succeeded.

A potential problem of the old code was:

Based on the randomness, the aggregated waiting time varied between ~ 10 to 20 seconds. This means a process might have failed unnecessarily after retrying the max amount of times during that period (before the expiry time was reached).