Redis Python
Backend & InfraRedis Python client
Release History
v7.2.18 fixesThis release focuses on bug fixes, particularly around cluster connection management and error handling, and removes deprecated attributes from OTel metrics.
v7.2.010 fixes12 featuresThis release introduces major support for Redis 8.6 features like Idempotent Producers and HOTKEYS, alongside comprehensive OpenTelemetry metrics integration. It also brings significant stability improvements, particularly around Redis Enterprise Cluster maintenance notifications and connection handling.
v7.1.12 featuresThis release introduces initial experimental health check policies and refactors the add_database method, alongside maintenance updates for MultiDBClients.
v7.1.0Breaking2 fixes5 featuresThe release adds MSETEX, CLAIM for XREADGROUP, routing policies, and experimental CAS/CAD and HYBRID search support, while removing Python 3.9 support and changing the default health‑check implementation, which requires migration steps.
v7.0.1This release primarily updates documentation for the multi-database client, adding new sections and revisions.
v7.0.0Breaking1 fix5 featuresThis release adds major new capabilities such as MultiDBClient and maintenance push notification support, but also includes breaking changes that require updates to eviction policy implementations, async RedisCluster usage, and several type‑hint adjustments.
v7.0.0b3Breaking1 fix2 featuresThis beta release introduces the experimental `MultiDBClient` for active‑active database setups and updates the `ping` command’s signature, requiring callers to adjust to the new return type.
v7.0.0b2Breaking2 featuresThe release adds SSL verification flag configuration and an 'auto' option for maintenance notifications, while renaming related classes and arguments, which requires code updates to maintain compatibility.
v7.0.0b1Breaking1 fix2 featuresThis release introduces maintenance push notification handling and a new WITHATTRIBS option, while breaking several APIs (cache setter, parse_list_to_dict, async RedisCluster context manager) and fixing deadlock issues by switching to RLock.
v6.4.01 featureThis release introduces a new epsilon property for the vsim command.
v6.3.013 fixes4 featuresThis release adds new BITOP and VAMANA index support, stream commands, and async retry equality, while fixing several bugs and removing a deprecated ClusterPipeline argument.
v5.3.1Maintenance release that relaxes the PyJWT version constraint for branch 5.3.
v6.1.12 fixesThis patch restores the original `check_hostname` default for `RedisSSLContext` and resolves a deadlock issue related to `__del__` calls.
v6.2.0Breaking2 fixes3 featuresThis release introduces async RedisCluster enhancements, adds RESP3 support, and drops Python 3.8 support while fixing several bugs.
v6.1.0Breaking4 fixes2 featuresThe release adds RedisCluster transaction support and makes Retry/backoff classes comparable and hashable, while fixing several SSL, runtime, and pipeline bugs; it also includes a breaking change to RedisSSLContext's default `check_hostname`.
v6.0.0Breaking11 fixes3 featuresRedis‑py 6.0.0 introduces new hash and Sentinel features, experimental VectorSet support, and several breaking changes such as stricter SSL hostname checks, mandatory retry objects for cluster clients, and removal of legacy modules.
v5.3.07 fixes5 featuresThis release adds token‑based authentication with new streaming interfaces, introduces exponential jitter backoff and a configurable load‑balancing strategy, deprecates old connection‑pool arguments and the read_from_replicas setting, and includes several bug fixes and documentation updates.
v6.0.0b23 fixes2 featuresThis release introduces experimental VectorSet command support and sentinel failover info, fixes recursive health checks and other bugs, and adds a shutdown-before-close improvement.
v6.0.0b1Breaking10 fixes5 featuresThe release introduces new hash commands, load‑balancing configuration, jittered exponential backoff, and several bug fixes, while removing RedisGears/RedisGraph support, updating FCALL typing, moving ClusterParser exceptions, and switching the default search dialect to version 2.
v5.3.0b53 fixes1 featureThis release adds token‑based authentication with an enhanced CredentialProvider interface and includes several bug fixes and test improvements.
Common Errors
ConnectionError3 reportsConnectionError in redis-python often arises from network issues, Redis server unavailability, or exceeding connection limits. Implement robust error handling with retry mechanisms for temporary network glitches. Also, ensure proper connection pooling configuration and close connections when no longer needed especially when using connection limits in RedisCluster mode; this prevents resource exhaustion and unexpected disconnections.
TimeoutError2 reportsTimeoutError in redis-python often arises from network issues, server overload, or excessively long-running operations, preventing the client from receiving a response within the configured timeout. Increase the timeout value in the Redis client configuration to accommodate slow operations, or implement retry logic with exponential backoff to handle transient network problems; also ensure the Redis server itself isn't overloaded. For cluster deployments, verify the health and connectivity of all nodes, and ensure proper failover configuration.
CancelledError2 reportsCancelledError in redis-python often arises from asynchronous operations being interrupted prematurely, leaving Redis connections or resources in an inconsistent state. Fix by ensuring proper error handling around `await` calls within async functions, especially during cancellation or timeout scenarios, and releasing any acquired Redis resources (like locks or connections) within `finally` blocks to guarantee cleanup regardless of cancellation. Also, defensively check the connection or object's state before interacting with Redis after a potential cancellation point.
LockNotOwnedError2 reportsThe "LockNotOwnedError" in redis-python usually arises when attempting to release a lock that either expired or is not currently held by the releasing client/thread. To fix it, ensure your unlock logic checks if the lock still exists and its value matches the client's identifier before attempting deletion. Add a Lua script to perform this atomic check ensuring only the lock owner can release the lock, preventing unintended releases or errors.
AttributeError1 reportAttributeError in redis-python often arises from attempting to access a method or attribute that doesn't exist on the Redis client object, usually after an upgrade or due to incorrect usage with Redis Cluster. Ensure your redis-python library is up-to-date and that you're using the correct methods for your Redis environment (standalone vs. cluster). Double-check the spelling and case-sensitivity of the method or attribute being called, and consult the redis-python documentation for appropriate use.
ReadOnlyError1 reportThe "ReadOnlyError" in redis-python usually arises when attempting write operations (e.g., SET, DEL) on a Redis instance configured as a read-only replica. To fix this, ensure your write operations are directed to the master instance. If using Sentinel, verify that your connection is correctly configured to connect to the master and not a read-only replica, potentially by specifically requesting the master's address.
Related Backend & Infra Packages
Production-Grade Container Scheduling and Management
Node.js JavaScript runtime ✨🐢🚀✨
Promise based HTTP client for the browser and node.js
A modern runtime for JavaScript and TypeScript.
Deliver web apps with confidence 🚀
Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
Subscribe to Updates
Get notified when new versions are released