Description
Version: 4.3.6 to 5.0.1
Platform: 3.8 to 3.11
Description: redis-py
does not attempt to reconnect when executing a pipeline for the errors provided in retry_on_error
, instead the exceptions are bubbled up.
This library accepts a retry policy and a list of Errors/Exceptions to attempt a retry.
When executing a single command in the Sync and Async versions, it calls call_with_retry
passing _disconnect_raise
as a callback in the client.py and asyncio/client.py. In both cases, _disconnect_raise
won't bubble up exceptions in the retry_on_error
list. See:
Line 522 in cc4bc1a
redis-py/redis/asyncio/client.py
Line 589 in cc4bc1a
As exceptions aren't bubbled up, retry will work as expected when calling that callback:
Line 49 in cc4bc1a
But this is not the case for Pipeline on both versions (Sync and Async). When executing a pipeline, this time the _disconnect_reset_raise
callback is passed in call_with_retry
:
Line 1436 in cc4bc1a
This callback DO bubble up all exceptions but TimeError, as the exception is bubbled up, call_with_retry
will raise an exception when executing this line of code:
Line 49 in cc4bc1a
Thus bubbling up the exception all the way up, ignoring the retry_on_error list and the retry policy in place.