fred.rs icon indicating copy to clipboard operation
fred.rs copied to clipboard

[Bug] Calling `RedisPool.active_connections()` may block forever

Open nakedible-p opened this issue 1 year ago • 1 comments

Fred version - 9.2.1 Redis version - 7.2 Platform - linux Deployment type - cluster

Describe the bug

I have a locally running Redis cluster, and a pool of 4 connections to it. I periodically call .active_connections().await?.len() to count the currently active connections. However, if all the connections are down, or currently reconnecting, or something, the call will block forever.

To Reproduce Steps to reproduce the behavior:

  1. Start up a redis cluster
  2. Start a program that will set up a pool of 4 against the cluster
  3. Call .active_connections().await in a loop every few second.
  4. Bring the cluster down.

The loop should stop as the call will never return. The expectation is that it would not block, but instead would return an empty list.

Probably doesn't need the pool, maybe doesn't need the cluster, but this is how I tested it.

Logs Didn't capture them.

nakedible-p avatar Oct 02 '24 13:10 nakedible-p

Hi @nakedible-p, good callout. I'll change that in the next update so it can preempt reconnections.

aembke avatar Oct 17 '24 02:10 aembke

Thanks @nakedible-p, this should be fixed in 9.3.0

aembke avatar Oct 20 '24 00:10 aembke