redis / redis-py

Redis Python client
MIT License
12.63k stars 2.52k forks source link

Not able to use hiredis with redis-py for server-assisted client-side caching #3358

Open mahudees opened 2 months ago

mahudees commented 2 months ago

Version: redis-py - 5.1.0b7, hiredis - 3.0.0

Platform: Python 3.9 in MacBook Apple M3 Pro

Description: Trying server-assisted client-side caching with redis-py version 5.1.0b7, it worked fine without hredis. Tried with hiredis for additional performance, getting the following error once hiredis is installed and ran the script. Does it require any additional change, from this https://redis.io/docs/latest/develop/connect/clients/python/redis-py/ came to know no additional changes is required for most of the cases.

/Users/mahudees/PycharmProjects/redis-client/.venv/bin/python /Users/mahudees/PycharmProjects/rsacsc-py-master/pythoncsc/csc.py Traceback (most recent call last): File "/Users/mahudees/PycharmProjects/rsacsc-py-master/pythoncsc/csc.py", line 129, in r.set("foo", "bar") File "/Users/mahudees/PycharmProjects/redis-client/.venv/lib/python3.9/site-packages/redis/commands/core.py", line 2334, in set return self.execute_command("SET", *pieces, options) File "/Users/mahudees/PycharmProjects/redis-client/.venv/lib/python3.9/site-packages/redis/client.py", line 566, in execute_command conn = self.connection or pool.get_connection(command_name, options) File "/Users/mahudees/PycharmProjects/redis-client/.venv/lib/python3.9/site-packages/redis/connection.py", line 1200, in get_connection connection.connect() File "/Users/mahudees/PycharmProjects/redis-client/.venv/lib/python3.9/site-packages/redis/connection.py", line 315, in connect self.on_connect() File "/Users/mahudees/PycharmProjects/redis-client/.venv/lib/python3.9/site-packages/redis/connection.py", line 439, in on_connect self._parser.set_invalidation_push_handler(self._cache_invalidation_process) AttributeError: '_HiredisParser' object has no attribute 'set_invalidation_push_handler'

Process finished with exit code 1

kosuke-zhang commented 2 months ago

3324 hasn't release yet.

mahudees commented 2 months ago

Thanks for the reply, when can we expect it to be released.

akx commented 2 months ago

No one knows. For the time being, use hiredis<3.0.

mahudees commented 2 months ago

Ok sure, Thank you.