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

channels_redis hard-requires EVAL command which fails on Pivotal's Shared Redis Release #290

Open
vanschelven opened this issue Feb 1, 2022 · 4 comments

Comments

@vanschelven
Copy link
Contributor

channels_redis uses .eval() in a number of locations.

On certain redis server installations EVAL has been renamed for security reasons.

Pivotal's Shared Redis Release is an example of a pre-packaged redis that has EVAL renamed by default.

Under those circumstances, this happens:

Traceback (most recent call last):
result = task.result()
File "python/lib/python3.9/site-packages/channels_redis/core.py", line 492, in receive
message_channel, message = await self.receive_single(
File "python/lib/python3.9/site-packages/channels_redis/core.py", line 547, in receive_single
content = await self._brpop_with_clean(
File "python/lib/python3.9/site-packages/channels_redis/core.py", line 383, in _brpop_with_clean
await connection.eval(cleanup_script, keys=[], args=[channel, backup_queue])
aioredis.errors.ReplyError: ERR unknown command `EVAL`, with args beginning with: ` local backed_up = redis.call('ZRANGE', ARGV[2], 0, -1, 'WITHSCORES') for i = #backed_up, 1, -2 do `,

It would be great if EVAL could be removed as a requirement.

Tangentially related: #226

@carltongibson
Copy link
Member

@vanschelven If you can show how these can be done without then we can remove them but otherwise I'm not sure we can do anything about this 🤔

@vanschelven
Copy link
Contributor Author

how these can be done

I was looking into it, there's "only 3" commits in which they were introduced but I had to conclude that I'm a bit out of my depth trying to approach this without any serious understanding.

@vanschelven
Copy link
Contributor Author

channels_redis.pubsub.RedisPubSubChannelLayer does not use EVAL, so for now that's a workable workaround (for me).

@carltongibson
Copy link
Member

It'll be the Lua scripting... I'm not sure we can do with out. 🤔

vanschelven added a commit to vanschelven/channels_redis that referenced this issue Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants