Bug 2031277

Summary: Review Request: python-flufl-lock - NFS-safe file locking with timeouts for POSIX and Windows
Product: [Fedora] Fedora Reporter: Michel Lind <michel>
Component: Package ReviewAssignee: Neal Gompa <ngompa13>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: ngompa13, package-review
Target Milestone: ---Flags: ngompa13: fedora-review+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-11 04:09:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2030061, 2031302    

Description Michel Lind 2021-12-10 22:10:40 UTC
Spec URL: https://salimma.fedorapeople.org/specs/python/python-flufl-lock.spec
SRPM URL: https://salimma.fedorapeople.org/specs/python/python-flufl-lock-6.0-1.fc35.src.rpm
Description: 
NFS-safe file locking with timeouts for POSIX and Windows.

The flufl.lock library provides an NFS-safe file-based locking algorithm
influenced by the GNU/Linux open(2) manpage, under the description of the O_EXCL
option.

    […] O_EXCL is broken on NFS file systems, programs which rely on it for
    performing locking tasks will contain a race condition. The solution for
    performing atomic file locking using a lockfile is to create a unique file
    on the same fs (e.g., incorporating hostname and pid), use link(2) to make a
    link to the lockfile. If link() returns 0, the lock is successful.
    Otherwise, use stat(2) on the unique file to check if its link count has
    increased to 2, in which case the lock is also successful.

The assumption made here is that there will be no outside interference, e.g. no
agent external to this code will ever link() to the specific lock files used.

Lock objects support lock-breaking so that you can’t wedge a process forever.
This is especially helpful in a web environment, but may not be appropriate for
all applications.

Locks have a lifetime, which is the maximum length of time the process expects
to retain the lock. It is important to pick a good number here because other
processes will not break an existing lock until the expected lifetime has
expired. Too long and other processes will hang; too short and you’ll end up
trampling on existing process locks – and possibly corrupting data. In a
distributed (NFS) environment, you also need to make sure that your clocks are
properly synchronized.

Fedora Account System Username: salimma

Comment 1 Neal Gompa 2021-12-11 00:17:56 UTC
Review notes:

[x]: Package follows Fedora Python Packaging Guidelines
[x]: Package builds and installs
[x]: No serious issues from rpmlint
[x]: License is correctly identified and installed

PACKAGE APPROVED.

Comment 2 Michel Lind 2021-12-11 03:53:21 UTC
Thanks!

❯ fedpkg request-repo python-flufl-lock 2031277
https://pagure.io/releng/fedora-scm-requests/issue/39356

Comment 3 Michel Lind 2021-12-11 04:09:06 UTC
Brainfade, this package is actually in Fedora