●Change8

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

  1. Replace any usage of the 'read_from_replicas' config with the new load‑balancing strategy configuration for cluster clients.
  2. Remove or update calls to connection pool get_connection that rely on the now‑deprecated arguments.
  3. If custom CredentialProvider implementations exist, ensure they implement the new get_credentials_async method or adapt accordingly.
  4. 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).