klynch/gitlabhq — comment on commit 4d37329c732b394dd521a6568be6b7a5b4c3bd68
File:  line 0
By klynch:

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.