spotify/luigi — pull request #497 by Tarrasch (2014-10-15 14:55:47+00:00)
Title: Fix lock file owner issue

When user abc123 runs luigi and leaves a lock file, you will have a
state something like this

$ ll /var/tmp/luigi/4c2ae353c4616cf210b3dc2b673d07ab.pid
-rwxrwxrwx 1 abc123 abc123 6 Oct 14 14:21 /var/tmp/luigi/4c2ae353c4616cf210b3dc2b673d07ab.pid*

Then, when user xyz789 runs the same luigi command which has the same
hash for the lock file, the user will run on a runtime exceptin when
the code in `luigi/lock.py` is doing chmod on the file, because the
owner of the file is abc123. Since there's no way to chown the file to
yourself if you're not the owner. So we just delete the file before
doing an overwrite of the file. This is the most reliable solution I
coud come up with.

I would love to create a test case for this, but I'm not sure how to do
it. Is there any way to chown a file to some other user (anyone) that
works on all supported luigi platforms?