[grid] Add Distributor Redis-backed implementation as built-in support#17396
Conversation
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
Review Summary by QodoAdd Redis-backed Distributor implementation for stateless Grid scaling
WalkthroughsDescription• Adds Redis-backed Distributor implementation for stateless horizontal scaling • Implements RedisBackedGridModel, RedisBackedNodeRegistry, and RedisBackedDistributor classes • Enables multiple Distributor replicas to share state via Redis with atomic slot reservation • Includes distributed health-check coordination via Redis leader-election locks • Adds comprehensive test coverage for Redis-backed components • Updates configuration to support --distributor-backend-url parameter File Changes1. java/src/org/openqa/selenium/grid/distributor/redis/RedisBackedDistributor.java
|
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
5d79014 to
461b29b
Compare
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>

🔗 Related Issues
💥 What does this PR do?
Redis-backed Distributor implementation for Selenium Grid, enabling stateless horizontal scaling with multiple Distributor replicas sharing state through Redis
Three new classes implement the full Distributor / GridModel / NodeRegistry contract against Redis:
RedisBackedGridModel: all grid state (node blobs, availability sets, slot session keys, health fail counts, last-touch timestamps) lives in RedisRedisBackedNodeRegistry— per-node health check runs are leader-elected via a per-node Redis SET NX PX lock, so exactly one replica performs the HTTP /status probe per interval regardless of replica count. On startup, reconstructs RemoteNode proxies from Redis availability sets, so new replicas immediately know about all live nodes.RedisBackedDistributor— extends Distributor, publishes a per-instance heartbeat key every 10 s with a 30 s TTL, and writes a draining marker onclose()for graceful shutdown.isReady()checks both the Redis connection and the event bus. Includes a static create(Config) factory that readsdistributor.backend-urlfrom config for use with--distributor-implementation.🔧 Implementation Notes
🤖 AI assistance
💡 Additional Considerations
🔄 Types of changes