{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/3"},{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/5"}],"enrichment":{"capability":"Provides NFS-safe file locking with timeout support across POSIX and Windows systems, using an atomic link-based algorithm to prevent race conditions.","skillfed_tags":["distributed-locking","nfs-safe","cross-platform"],"use_cases":["Serialize access to shared configuration or data files in a distributed system where multiple hosts mount the same NFS volume.","Prevent concurrent writes to a shared database or log file in a multi-process web application or job queue.","Implement a distributed task lock so only one worker process executes a critical operation across a cluster.","Protect against race conditions in CI/CD pipelines or build systems that run on shared network storage.","Coordinate resource access in containerized or Kubernetes environments where pods may share persistent volumes."],"what_it_does":"flufl.lock is a file-based locking library that solves the race-condition problem inherent in NFS file systems by using an atomic link-based algorithm inspired by the O_EXCL flag behavior. Instead of relying on exclusive file creation (which is broken on NFS), it creates a unique temporary file and uses the link(2) system call to atomically establish the lock\u2014a technique that works correctly across network file systems and local filesystems alike.\n\nThe library is designed for distributed and multi-process environments where you need to coordinate access to shared resources. It supports lock breaking with configurable timeouts, allowing other processes to forcibly acquire a lock if the holder exceeds its declared lifetime. This prevents permanent deadlocks but requires careful tuning: set the lifetime too long and processes will hang waiting; too short and you risk trampling on active locks and corrupting data. It runs on POSIX systems (Linux, macOS) and Windows, making it suitable for cross-platform applications that must coordinate file access.","worth_installing":"Yes. This is a mature, actively maintained library with no known vulnerabilities, low install friction, and a permissive license. Install it if you need cross-platform, NFS-safe file locking with timeout support. The main consideration is tuning the lock lifetime correctly for your use case; if you're unsure whether you need NFS safety specifically, a simpler locking mechanism may suffice."},"id":"flufl-lock","links":{"html":"https://skillfed.io/packages/flufl-lock","md":"https://skillfed.io/packages/flufl-lock.md","pypi":"https://pypi.org/project/flufl-lock/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-27","license_spdx":null,"license_treatment":"permissive","name":"flufl.lock","python_support":"supports_current","summary":"NFS-safe file locking with timeouts for POSIX and Windows"},"popularity":{"monthly_downloads":3168832,"position":2718,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"9.1.0"}
