gitlabhq/gitlabhq — pull request #31 by klynch (2011-10-17 06:02:25+00:00)
Title: Must ensure that the lock is always removed.

I got into a state where the file existed but was still locked. Ensuring the unlock guarantees the file will be unlocked even if an exception arises in the block.

Also, Timeout::timeout(20) can be called like Timeout::timeout(20, Gitosis::AccessDenied) to cast timeout exceptions automatically. This will prevent exceptions in yield from being recast to Gitosis specific exceptions.

Also, you might want to consider removing the file after the lock.