LinkLockFile leaves stale unique_name

Bug #1489670 reported by Chris Macklin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pylockfile
Won't Fix
Undecided
Unassigned

Bug Description

If break_lock() is called on a LinkLockFile, it cleans up the .lock file but not the unique name. The bug is pretty obvious:

def break_lock(self):
        if os.path.exists(self.lock_file):
            os.unlink(self.lock_file)

release() calls os.unlink(self.unique_name) in addition to os.unlink(self.lock_file). break_lock() should also call os.unlink(self.unique_name).

EDIT: I am an idiot and of course the issue is more complicated than that. If break_lock is called, then the unique_name link is that of the process that is already locking, not the process that it is being unlocked from. I'm not really sure what to do about this, but it is a pretty frustrating issue. break_lock is a useful interprocess signal, but it leaves the directory the locked file is in strewn with stale unique_name links.

description: updated
Revision history for this message
Ben Nemec (bnemec) wrote :

pylockfile has been retired. We won't be making any more updates to it. See the fasteners library for a supported alternative.

Changed in pylockfile:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.