Skip to content

Async pipeline doesn't work with some commands in 5.1 #3391

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

Closed
RafalBielickiIM opened this issue Sep 29, 2024 · 2 comments · Fixed by #3402
Closed

Async pipeline doesn't work with some commands in 5.1 #3391

RafalBielickiIM opened this issue Sep 29, 2024 · 2 comments · Fixed by #3402
Assignees
Labels

Comments

@RafalBielickiIM
Copy link

RafalBielickiIM commented Sep 29, 2024

Thanks for wanting to report an issue you've found in redis-py. Please delete this text and fill in the template below.
It is of course not always possible to reduce your code to a small test case, but it's highly appreciated to have as much data as possible. Thank you!

Version: 5.1

Platform: Tested on 3.10,3.11,3.12 on Ubuntu & OSX

Description:

redis = Redis(host='localhost', port=6379)
await redis.ping()
pipe = redis.pipeline()
pipe.hgetall('test')
await pipe.execute()```

```TypeError                                 Traceback (most recent call last)
Cell In[46], line 6
      4 pipe = redis.pipeline()
      5 pipe.hgetall('test')
----> 6 await pipe.execute()

File ~//lib/python3.12/site-packages/redis/asyncio/client.py:1533, in Pipeline.execute(self, raise_on_error)
   1530 conn = cast(Connection, conn)
   1532 try:
-> 1533     return await conn.retry.call_with_retry(
   1534         lambda: execute(conn, stack, raise_on_error),
   1535         lambda error: self._disconnect_raise_reset(conn, error),
   1536     )
   1537 finally:
   1538     await self.reset()

File ~/lib/python3.12/site-packages/redis/asyncio/retry.py:59, in Retry.call_with_retry(self, do, fail)
     57 while True:
     58     try:
---> 59         return await do()
     60     except self._supported_errors as error:
     61         failures += 1

File ~/lib/python3.12/site-packages/redis/asyncio/client.py:1427, in Pipeline._execute_transaction(self, connection, commands, raise_on_error)
   1425 command_name = args[0]
   1426 if command_name in self.response_callbacks:
-> 1427     r = self.response_callbacks[command_name](r, **options)
   1428     if inspect.isawaitable(r):
   1429         r = await r

TypeError: <lambda>() got an unexpected keyword argument 'keys'```
@RafalBielickiIM RafalBielickiIM changed the title Async pipeline doesn't work. Async pipeline doesn't work with some commands Sep 29, 2024
@RafalBielickiIM RafalBielickiIM changed the title Async pipeline doesn't work with some commands Async pipeline doesn't work with some commands in 5.1 Sep 29, 2024
@dmaier-redislabs
Copy link
Contributor

Hi @RafalBielickiIM,

thanks for reporting this bug. We will take a look.

@vladvildanov Could you please verify, fix, and add a test case that covers this issue.

Regards,
David

@vladvildanov
Copy link
Collaborator

Hi

This bug seems to be a side-effect of Client-side caching feature been added to 5.1. Apologise for the inconvenience. Will be included into the next patch version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants