Race in t.p.lockfile.FilesystemLock

Bug #1590775 reported by Gavin Panella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Medium
Unassigned
Twisted
Unknown
Unknown

Bug Description

When Filesystem.lock() notices a stale lock its next step is to remove the lock file. If a concurrent process is performing the same operation it may be able to remove the stale lock file and write a fresh one in the interval between when the first process detects the stale lock and when the first process removes it. The result is that both processes believe they have the lock. When unlocking, the second process will notice the discrepancy: if the first process has released the lock, it will crash with FileNotFoundError (or IOError with errno=ENOENT in Python 2); if the first process still holds the lock it will crash with ValueError.

See https://twistedmatrix.com/trac/ticket/8440 for the original bug report, which includes a script to reproduce the race.

This affects MAAS because it uses Twisted's FilesystemLock in SystemLock and its descendents.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi!

**This is an automated message**

We believe this is may no longer be an issue in the latest MAAS release. Due to the report date of this, we are currently marking it as Invalid. If you believe this bug report still valid against the latest release of MAAS, or if you are still interested in this, please re-open this bug report.

Thanks

Changed in maas:
status: Triaged → Invalid
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.