You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform
Python 3.11.3 on the latest respective docker image (python:$PYTHON_VERSION)
Description
Our code executes lua scripts, that contain various instructions (e.g., rpush). We have set up retry_on_error with a few errors, including ReadOnlyError, to more gracefully handle failovers. However, and specifically in the case of executing a script, the error will be the more general ResponseError and not ReadOnlyError.
And if the script fails (e.g., rpush when the instance of read-only), the connection is not retried, I presume because the error is not ReadOnlyError, but ResponseError instead:
ResponseError: Error running script (call to f_1e84a64d649a247ba53ce64b0be7bbedd64fe1b4): @user_script:28: @user_script: 28: -READONLY You can't write against a read only replica.
(line 28 is rpush in this case)
I'm not sure if this is a bug or working as intended, it depends on:
Is ReadOnlyError more appropriate than ResponseError in this case?
Should register_script(...)() runs be retried per retry_on_error?
The text was updated successfully, but these errors were encountered:
Version
redis-py 5.2.0 with Redis 6.2.6
Platform
Python 3.11.3 on the latest respective docker image (
python:$PYTHON_VERSION
)Description
Our code executes lua scripts, that contain various instructions (e.g.,
rpush
). We have set upretry_on_error
with a few errors, includingReadOnlyError
, to more gracefully handle failovers. However, and specifically in the case of executing a script, the error will be the more generalResponseError
and notReadOnlyError
.A simplified example would be:
And if the script fails (e.g.,
rpush
when the instance of read-only), the connection is not retried, I presume because the error is notReadOnlyError
, butResponseError
instead:(line 28 is
rpush
in this case)I'm not sure if this is a bug or working as intended, it depends on:
ReadOnlyError
more appropriate thanResponseError
in this case?register_script(...)()
runs be retried perretry_on_error
?The text was updated successfully, but these errors were encountered: