Add a RedisProvider class
Description
This MR adds a RedisProvider
class that manages the connection to redis (either a single server or multiple servers managed with Redis Sentinel) and provides a small abstraction for retrying operations when a Sentinel managed server disconnects or times out.
Changes proposed in this merge request:
- Add the
RedisProvider
class -
RedisActionCache
andRedisStorage
constructors modified to take aRedisProvider
instead of individual redis connection arguments -
RedisActionCache
andRedisStorage
refactored to use theRedisProvider
interface which simplifies interacting with sentinel managed interfaces - Fixes a bug where the
db
andpassword
options were not used when connecting with a sentinel
Config file changes
- Adds a
!redis-connection
tag for configuring redis connection information in theconnections
section of a config. - Updates
!redis-storage
and!redis-action-cache
to add aredis
argument that specifies a!redis-connection
rather than specifying the connection information directly. The old arguments are still accepted, with a warning, for now.
Validation
Run a BuildGrid instance with both standalone and Sentinel-managed redis servers. Verify that redis commands are sent to the correct (master/replica) instance.
Edited by Jeremy Devenport