v5.3.0
đŚ redis-pythonView on GitHub â
⨠5 featuresđ 7 fixes⥠2 deprecationsđ§ 11 symbols
Summary
This 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.
Migration Steps
- Replace any usage of the 'read_from_replicas' config with the new loadâbalancing strategy configuration for cluster clients.
- Remove or update calls to connection pool get_connection that rely on the nowâdeprecated arguments.
- If custom CredentialProvider implementations exist, ensure they implement the new get_credentials_async method or adapt accordingly.
- Verify that PyJWT is installed (>=2.0) if tokenâbased authentication is used.
⨠New Features
- Introduced tokenâbased authentication with a new StreamingCredentialProvider interface.
- Extended CredentialProvider with an asynchronous get_credentials_async method.
- Added eventâdriven entities: Dispatcher, Listener, and Events for handling streamed credential events.
- Implemented exponential backoff with jitter for retry logic.
- Added configurable loadâbalancing strategy for cluster clients, replacing the read_from_replicas setting.
đ Bug Fixes
- Cluster topology is now reinitialized when SlotNotCoveredError is raised, enabling proper retry handling.
- Fixed documentation for tokenâbased authentication.
- Added missing PyJWT dependency.
- Stabilized flaky TokenManager test.
- Corrected attribute reuse bug in redis.connection.CacheProxyConnection.
- Moved self._lock initialization to the Pool constructor.
- Stopped decreasing the created connections count when releasing a connection not owned by the pool (fixes #2832).
Affected Symbols
⥠Deprecations
- Deprecated unused arguments in connection pools' get_connection functions (see #3517, #3625).
- Deprecated the 'read_from_replicas' configuration; replace it with the new load balancing strategy configuration for cluster clients (see #3563).