Skip to main content

Build Status Coverage Status PyPI version

fredlock

fredlock - Redis RedLock based distributed locking tool

fredlock distributed locking utility

fredlock is a distributed locking tool based on Redis RedLock algorithm intended as a replacement for "flock" command line utility, it allows to run commands on multiple machines with a guarantee that no two instances will be running at the same time.

fredlock requires a shared Redis instance to provide locking

Release Notes

  • 0.1.3 - No Changes (testing auto-release)

  • 0.1.2 - No Changes (testing auto-release)

  • 0.1.1 - Bugfixes

    • Removed --redis_ssl and --redis-unix-socket-path command line options for now, not compatible with older redis clients
    • Fixed sleep after acquire/before release
  • 0.1.0 - Initial version

    • Features
      • Auto-release of a lock after x seconds if command does not complete in allotted time. (--auto-release-time x)
      • Specify how long to wait for lock
        • Indefinitely (--wait-timeout -1)
        • Limited Time (--wait-timeout x (x > 0))
        • Do not wait (--wait-timeout 0)
      • Custom Optional Delays:
        • After lock acquire, before command execution (--delay-after-acquire x)
        • After command execution, before lock release ( --delay-before-release x)

TODOs:

Some other ideas/desired features:

  • Quiet timeouts (no output/failure if not run due to timeout trying to get lock)
  • Config file (currently we support cli and env variables)
  • Redis Cluster support
  • Lock Namespacing

Installation

From PyPi:

pip install fredlock

Usage

Full build-in usage is available with --help flag.

Run command with automatically-generated name lock

Simplest usage to run a command command arg1 arg2 with lock command:

fredlock run command arg1 arg2

Run command with a specified name lock

Simplest usage to run a command command arg1 arg2 with lock lockname:

fredlock --name lockname run command arg1 arg2

Release files for fredlock 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fredlock 0.1.3
File Size Uploaded
fredlock-0.1.3.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fredlock 0.1.3
File Interpreter ABI Platform
fredlock-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 24.6 kB

Release files / fredlock-0.1.3.tar.gz

Download URL fredlock-0.1.3.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a105f2bb8e53cea7bf7f80436d27c6256e038947eef36a526c3306645f0f1511
BLAKE2b-256 checksum
How to use checksums
a448c5ba076343fefc9b248791fcca5ef0e9e52e2bb4227e3ba6d533370358d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / fredlock-0.1.3-py3-none-any.whl

Download URL fredlock-0.1.3-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7be14c3534c0db1e4e55e60dd9c07026e58e72a75345ddafaba16fe6540de2e6
BLAKE2b-256 checksum
How to use checksums
469a4c6a721a0558ddfc93486d297d837a61f2da533e1a637d90bdb6e21279cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page