-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
We use redis.asyncio.StrictRedis and redis.asyncio.BlockingConnectionPool, with some specific Retry configuration:
from redis.asyncio import BlockingConnectionPool, StrictClient
from redis.exceptions import ConnectionError, TimeoutError
from redis.asyncio.retry import Retry
errors = (ConnectionError, TimeoutError)
retry = Retry(backoff=backoff, retries=retries, supported_errors=errors)
pool = BlockingConnectionPool(retry=retry, retry_on_timeout=True)
client = StrictClient(connection_pool=pool)And that doesn't work as expected! There are no retries at all on ConnectionError exceptions!
Here's what happens:
When executing a command, an error handler is passed to call_with_retry. That error handler is the _disconnect_raise function, which re-raises the exception if that exception is not a TimeoutError. Meaning that, in case of a ConnectionError, call_with_retry will raise and exit before having a chance to retry the operation.
Metadata
Metadata
Assignees
Labels
No labels