Race in LockFile.py resulting in extraneous log entries.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Mailman |
New
|
Low
|
Unassigned |
Bug Description
There is a race condition (that does not affect correct
operation of Mailman) in .../Mailman/
race results in entries to the "locks" log file
(usually in pairs) that are unnecessary and confusing.
If there is a process holding a lock for a file, and a
process waiting for that lock to be freed, the
following sequence can occur:
1) The waiting process executes os.link(). Since the
running process still has the lock, this fails with EEXIST.
2) The running process releases the lock, and removes
the lock file.
3) The waiting process proceeds with it's checks, and
checks self.__linkcount() which returns -1 due to an
ENOENT error. This throws an error into the "locks"
log file.
4) The waiting process continues processing, checks
it's timeout, and then checks to see if the lock
lifetime has expired. The lifetime check is based on a
call to self.__
an ENOENT error. This results in the lockfile being
declared stale, and self.__break() is called. This
then throws a second error into the "locks" log file.
The attached patch checks for these ENOENT errors,
immediately restarting the loop when they are detected.
It does not affect operation is the lock file exists
and is held by another process.
Brian Greenberg.
The file LockFile.py.patch was added: Patch to LockFile.py to fix race.