Skip to content

exception raised when trying to use client-side caching on an environment where hiredis is installed #3627

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

Open
kevin-lee-dialpad opened this issue May 1, 2025 · 1 comment

Comments

@kevin-lee-dialpad
Copy link

kevin-lee-dialpad commented May 1, 2025

There is a bug in CacheProxyConnection that throws an exception when attempted to use client-side caching on an environment where hiredis is installed, and the issue is still present in v6.0.0 that just got released.

traceback:

"/Users/kevinlee/Desktop/projects/firespotter_v2/venv3.11/lib/python3.11/site-packages/redis/connection.py", line 994, in _enable_tracking_callback
    conn._parser.set_invalidation_push_handler(self._on_invalidation_callback)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: '_HiredisParser' object has no attribute 'set_invalidation_push_handler'

it's basically expecting a _RESP3Parser but redis-py ends up setting _HiredisParser instead when hiredis is available.

workaround for now is obviously to avoid installing hiredis when using client-side caching, but we want it fixed because we'd like to maintain 2 separate connection pools, 1 with client-side caching enabled and the other without.

@petyaslavova
Copy link
Collaborator

Hi @kevin-lee-dialpad , thank you for pointing this out! We'll have a look at this.

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