Changelog¶
v4.1.0 (todo)¶
Dropped support for EOL Python 3.7, 3.8 and 3.9. Minimum version is 3.10.
Added support for valkey and django-valkey.
v4.0.1 (2026-04-08)¶
Fixed typo when setting daemon mode for the renewal thread. Contributed by Eeo Jun in #94.
Fixed syntax in some examples in documentation. Contributed by Lee Bush in #110.
Added the
blockingargument toLock.__init__to allow this behavior when using it as a context manager. Contributed by Andrew Petriv in #102.
v4.0.0 (2022-10-17)¶
Dropped support for Python 2.7 and 3.6.
Switched from Travis to GitHub Actions.
Made logging messages more consistent.
Replaced the
redis_lock.refresh.thread.*loggers with a singleredis_lock.refresh.threadlogger.Various testing cleanup (mainly removal of hardcoded tmp paths).
v3.7.0 (2020-11-20)¶
Made logger names more specific. Now can have granular filtering on these new logger names:
redis_lock.acquire(emits DEBUG messages)redis_lock.acquire(emits WARN messages)redis_lock.acquire(emits INFO messages)redis_lock.refresh.thread.start(emits DEBUG messages)redis_lock.refresh.thread.exit(emits DEBUG messages)redis_lock.refresh.start(emits DEBUG messages)redis_lock.refresh.shutdown(emits DEBUG messages)redis_lock.refresh.exit(emits DEBUG messages)redis_lock.release(emits DEBUG messages)
Contributed by Salomon Smeke Cohen in #80..
Fixed few CI issues regarding doc checks. Contributed by Salomon Smeke Cohen in #81..
v3.6.0 (2020-07-23)¶
Improved
timeout/expirevalidation so that:timeoutandexpire are converted to ``Noneif they are falsy. Previously onlyNonedisabled these options, other falsy values created buggy situations.Using
timeoutgreater thanexpireis now allowed, ifauto_renewalis set toTrue. Previously aTimeoutTooLargeerror was raised. See #74..Negative
timeoutorexpireare disallowed. Previously such values were allowed, and created buggy situations. See #73..
Updated benchmark and examples.
Removed the custom script caching code. Now the
register_scriptmethod from the redis client is used. This will fix possible issue with redis clusters in theory, as the redis client has some specific handling for that.
v3.5.0 (2020-01-13)¶
Added a
lockedmethod. Contributed by Artem Slobodkin in #72..
v3.4.0 (2019-12-06)¶
Fixed regression that can cause deadlocks or slowdowns in certain configurations. See: #71..
v3.3.1 (2019-01-19)¶
Fixed failures when running python-redis-lock 3.3 alongside 3.2. See: #64..
v3.3.0 (2019-01-17)¶
Fixed deprecated use of
warningsAPI. Contributed by Julie MacDonell in #54..Added
auto_renewaloption inRedisCache.lock(the Django cache backend wrapper). Contributed by c in #55..Changed log level for “%(script)s not cached” from WARNING to INFO.
Added support for using
decode_responses=True. Lock keys are pure ascii now.
v3.2.0 (2016-10-29)¶
Changed the signal key cleanup operation do be done without any expires. This prevents lingering keys around for some time. Contributed by Andrew Pashkin in #38..
Allow locks with given id to acquire. Previously it assumed that if you specify the id then the lock was already acquired. See #44. and #39..
Allow using other redis clients with a
strict=False. Normally you’re expected to pass in an instance ofredis.StrictRedis.Added convenience method locked_get_or_set to Django cache backend.
v3.1.0 (2016-04-16)¶
Changed the auto renewal to automatically stop the renewal thread if lock gets garbage collected. Contributed by Andrew Pashkin in #33..
v3.0.0 (2016-01-16)¶
Changed
releaseso that it expires signal-keys immediately. Contributed by Andrew Pashkin in #28..Resetting locks (
resetorreset_all) will release the lock. If there’s someone waiting on the reset lock now it will acquire it. Contributed by Andrew Pashkin in #29..Added the
extendmethod onLockobjects. Contributed by Andrew Pashkin in #24..Documentation improvements on
releasemethod. Contributed by Andrew Pashkin in #22..Fixed
acquire(block=True)handling whenexpireoption was used (it wasn’t blocking indefinitely). Contributed by Tero Vuotila in #35..Changed
releaseto check if lock was acquired with he same id. If not,NotAcquiredwill be raised. Previously there was just a check if it was acquired with the same instance (self._held). BACKWARDS INCOMPATIBLERemoved the
forceoption fromrelease- it wasn’t really necessary and it only encourages sloppy programming. See #25.. BACKWARDS INCOMPATIBLEDropped tests for Python 2.6. It may work but it is unsupported.
v2.3.0 (2015-09-27)¶
Added the
timeoutoption. Contributed by Victor Torres in #20..
v2.2.0 (2015-08-19)¶
Added the
auto_renewaloption. Contributed by Nick Groenen in #18..
v2.1.0 (2015-03-12)¶
New specific exception classes:
AlreadyAcquiredandNotAcquired.Slightly improved efficiency when non-waiting acquires are used.
v2.0.0 (2014-12-29)¶
Rename
Lock.tokentoLock.id. Now only allowed to be set via constructor. Contributed by Jardel Weyrich in #11..
v1.0.0 (2014-12-23)¶
Fix Django integration. (reported by Jardel Weyrich)
Reorganize tests to use py.test.
Add test for Django integration.
Add
reset_allfunctionality. Contributed by Yokotoka in #7..Add
Lock.resetfunctionality.Expose the
Lock.tokenattribute.
v0.1.2 (2013-11-05)¶
?
v0.1.1 (2013-10-26)¶
?
v0.1.0 (2013-10-26)¶
?
v0.0.1 (2013-10-25)¶
First release on PyPI.