Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.0.0b1 breaks script_flush on pre-6.2 server #1639

Closed
bmerry opened this issue Oct 25, 2021 · 1 comment · Fixed by #1641
Closed

4.0.0b1 breaks script_flush on pre-6.2 server #1639

bmerry opened this issue Oct 25, 2021 · 1 comment · Fixed by #1641
Assignees
Labels
bug Bug

Comments

@bmerry
Copy link
Contributor

bmerry commented Oct 25, 2021

Version: redis-py 4.0.0b1, redis 5.0.7

Platform: Python 3.8.10 on Ubunutu 20.04

Description: In 4.0.0b1, the implementation of script_flush always calls either SCRIPT FLUSH SYNC or SCRIPT FLUSH ASYNC on the server. However, the SYNC/ASYNC modifier was only added in Redis 6.2, making it fail on older versions.

To reproduce (assuming a Redis server on localhost):

import redis
r = redis.Redis('localhost')
r.script_flush()

Result: ResponseError: Unknown subcommand or wrong number of arguments for 'FLUSH'. Try SCRIPT HELP.

Apart from wanting to support older Redis versions, the documentation suggests that providing neither modifier is not simply equivalent to providing SYNC. Rather, it leaves it up to a configuration setting on the server, and I feel like calling r.script_flush() should respect that server-side default.

@bmerry bmerry changed the title 4.0.0b1 breaks script_flush` on pre-6.2 server 4.0.0b1 breaks script_flush on pre-6.2 server Oct 25, 2021
@chayim chayim added the bug Bug label Oct 25, 2021
chayim added a commit to chayim/redis-py that referenced this issue Oct 25, 2021
@chayim
Copy link
Contributor

chayim commented Oct 25, 2021

Thank you for reporting @bmerry. The PR you see referenced above looks to fix this. We now default to None, which solves both behaviours. Of note, the server can have a different default set - meaning this is a better implementation. Thank you for catching this! It'll be in 4.0.0b2!

@chayim chayim self-assigned this Oct 25, 2021
bmerry added a commit to jamesls/fakeredis that referenced this issue Oct 25, 2021
Version 4.0.0b1 won't pass the test suite due to
redis/redis-py#1639, but so far it looks like
general functionality is working.
bmerry added a commit to jamesls/fakeredis that referenced this issue Oct 25, 2021
Version 4.0.0b1 won't pass the test suite due to
redis/redis-py#1639, but so far it looks like
general functionality is working.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants