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

Wrong number of response items from pipeline execution error on pipeline when client-side-caching is enabled #3453

Open
iRhonin opened this issue Dec 9, 2024 · 0 comments

Comments

@iRhonin
Copy link

iRhonin commented Dec 9, 2024

Version: redis-py==5.2.0 redis==7.4.1

Platform: Python==3.8.18 Ubuntu==24.04

Description:

I am getting Wrong number of response items from pipeline execution error when client-side-caching is enabled. The error occurs when using pipeline and at least one of the keys in the pipeline is cached in client.

Steps to reproduce:

r = Redis(protocol=3, cache_config=CacheConfig())

pipe = r.pipeline()
pipe.set('foo', 5)
pipe.set('bar', 18.5)
pipe.execute()

r.get('foo')

pipe = r.pipeline()
pipe.set('foo', 5)
pipe.set('bar', 18.5)
pipe.execute()

Error:

ResponseError                             Traceback (most recent call last)
Cell In[43], line 4
      2 pipe.set('foo', 5)
      3 pipe.set('bar', 18.5)
----> 4 pipe.execute()

File ~/.pyenv/versions/3.8.18/lib/python3.8/site-packages/redis/client.py:1530, in Pipeline.execute(self, raise_on_error)
   1527     self.connection = conn
   1529 try:
-> 1530     return conn.retry.call_with_retry(
   1531         lambda: execute(conn, stack, raise_on_error),
   1532         lambda error: self._disconnect_raise_reset(conn, error),
   1533     )
   1534 finally:
   1535     self.reset()

File ~/.pyenv/versions/3.8.18/lib/python3.8/site-packages/redis/retry.py:62, in Retry.call_with_retry(self, do, fail)
     60 while True:
     61     try:
---> 62         return do()
     63     except self._supported_errors as error:
     64         failures += 1

File ~/.pyenv/versions/3.8.18/lib/python3.8/site-packages/redis/client.py:1531, in Pipeline.execute.<locals>.<lambda>()
   1527     self.connection = conn
   1529 try:
   1530     return conn.retry.call_with_retry(
-> 1531         lambda: execute(conn, stack, raise_on_error),
   1532         lambda error: self._disconnect_raise_reset(conn, error),
   1533     )
   1534 finally:
   1535     self.reset()

File ~/.pyenv/versions/3.8.18/lib/python3.8/site-packages/redis/client.py:1410, in Pipeline._execute_transaction(self, connection, commands, raise_on_error)
   1408 if len(response) != len(commands):
   1409     self.connection.disconnect()
-> 1410     raise ResponseError(
   1411         "Wrong number of response items from pipeline execution"
   1412     )
   1414 # find any errors in the response and raise if necessary
   1415 if raise_on_error:

ResponseError: Wrong number of response items from pipeline execution
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

1 participant