libcloud
libcloud copied to clipboard
Improper lock usage leads to inode overflow in LockLocalStorage implementation
Summary
Behaviour of fasteners.InterProcessLock is pretty weird: class creates a lockfile by provided path, if it doesn't exist, but not manage to remove it after lock is released.
It may lead to uncontrolled lockfiles spam in /tmp folder just because libcloud local driver is not removing this lockfile either.
Detailed Information
This issue encountered in cassandra-medusa v0.15 and lower, which was using apache-libcloud<3.4.0,>=3.3.0 as a dependency.
Please see https://github.com/thelastpickle/cassandra-medusa/issues/528 for more details.
Seems like the lightweight fix is to run
with contextlib.suppress(FileNotFoundError):
os.remove(filename)
just right in the exit method.