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

Timeouts when parsing messages in redis/asyncio can corrupt connection #2513

Closed
kristjanvalur opened this issue Dec 14, 2022 · 1 comment
Closed
Labels
bug Bug

Comments

@kristjanvalur
Copy link
Contributor

kristjanvalur commented Dec 14, 2022

In pull requests #2295 and #2360 I made significant change on the way timeouts are handled in the async Connection, bringing it more in line with regular Python asyncio practices. In particular, we got rid of the unfortunate can_read() function which was a holdover from the synchronous implementation.

Unfortunately, a problem was introduced:
If an asyncio.TimeoutError was raised during the IO of a message, when using the PythonParser, the connection would be left in an unusable state. This is in constrast to the HiredisParser, where IO and parsing are separate.

The fix is relatively simple. PythonParser needs to be resumable, if it is interrupted in the middle of parsing a single message. Two alternative PRs address this: #2510 and #2512, which differ only in the architectural details of how to achieve this.

@dvora-h
Copy link
Collaborator

dvora-h commented Jan 8, 2023

Fixed in #2510

@dvora-h dvora-h closed this as completed Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

No branches or pull requests

2 participants