Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

add RESP3 support #755

Open
databasedav opened this issue May 27, 2020 · 4 comments
Open

add RESP3 support #755

databasedav opened this issue May 27, 2020 · 4 comments
Labels
resolved-via-latest This indicates this issue is either resolved or invalid as of the latest version.

Comments

@databasedav
Copy link

databasedav commented May 27, 2020

doing await redis.execute(b'HELLO', 3) raises aioredis.errors.ProtocolError: Protocol error, got "%" as reply type byte

@seandstewart
Copy link
Collaborator

This issue should be resolved as of #891 - please feel free to pull in the latest master and test to ensure this is the case.

@seandstewart seandstewart added the resolved-via-latest This indicates this issue is either resolved or invalid as of the latest version. label Mar 19, 2021
@peedrr
Copy link

peedrr commented Feb 9, 2022

Hi @seandstewart - thank you for your work on this library.

I can confirm that, using v.2.0.1, this is not resolved. This results in an InvalidResponse error:

File /usr/local/Caskroom/miniconda/base/envs/triage-calc/lib/python3.9/site-packages/aioredis/connection.py:406, in PythonParser.read_response(self)
    403  byte, response = raw[:1], raw[1:]
    405 if byte not in (b"-", b"+", b":", b"$", b"*"):
--> 406     raise InvalidResponse(f"Protocol Error: {raw!r}")
    408 # server returned an error
    409 if byte == b"-":

InvalidResponse: Protocol Error: b'%7']()

Perhaps this is indeed the correct response, i.e. that the library does not support RESP3, however considering the title of this issue, and the label you assigned to it, one would assume that the library does now support RESP3. I think some clarification is needed.

Thanks.

@seandstewart
Copy link
Collaborator

Hey @peedrr -

Apologies, this was incorrectly triaged. However, the latest hiredis-py has support for all aspects of the RESP3 which are currently in-use, so if you use that library your client will have RESP3 support.

Pure-Python support was added in #1287, but that has a long way to go till it's ready to merge.

I'll re-open this issue in the meantime.

@seandstewart seandstewart reopened this Feb 9, 2022
@peedrr
Copy link

peedrr commented Feb 9, 2022

Thanks for the quick response.

Please excuse what might be quite a basic question: I have just reinstalled aioredis using pip install aioredis[hiredis]. If I run await r.execute_command('HELLO', 3) I still get the same error. What am I missing here?

If some context helps at all, I am trying to implement Redis server-assisted client-side caching. As I'm sure you know, RESP3 allows for two-way communication between client and server, therefore the invalidate messages from the server are sent direct and are guaranteed, whereas the RESP2 implementation requires two client connections, with the server -> client communication being done over a Pub/Sub (and therefore with no guarantee of delivery). From what I understand so far, it seems the first step is to promote the client to use RESP3 by issuing the above HELLO command, and so I can't seem to move beyond this point.

Incidentally, if you know of any resources which might help me to get this working, I would really appreciate some pointers. I don't necessarily require my implementation to be async, therefore any resources which use redis-py would also be useful.

Thanks again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-via-latest This indicates this issue is either resolved or invalid as of the latest version.
Projects
None yet
Development

No branches or pull requests

3 participants