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
Off by 1 - Canceling async Redis command leaves connection open, in unsafe state for future commands #2624
Comments
Is it the problem about OpenAI https://openai.com/blog/march-20-chatgpt-outage ? |
Yep, that's the one, and the #2641 has not fixed it fully, as I already commented here: #2641 (comment) I am asking for this ticket to be re-oped, since I can still reproduce the problem in the latest 4.5.3. version |
Did GPT4 help with debugging? |
I wonder how much OpenAI/ChatGPT is funding maintenance of this library. |
Folks, I reopened this accidentally - but wanted to ensure there was communication that is clear. Please note - we're tracking in #2665. Let's align in a single issue - it makes it easier to co-ordinate, track, and respond. |
Version: 4.5.1
Platform: Python 3.8 / Ubuntu (but really, any platform will likely suffer the same issue)
Description: Canceling async Redis command leaves connection open, in unsafe state for future commands
The issue here is really the same as #2579, except that it generalizes it to all commands (as opposed to just blocking commands).
If async Redis request is canceled at the right time, after the command was sent but before the response was received and parsed, the connection is left in an unsafe state for future commands. The following redis operation on the same connection will send the command, and then promptly continue to read the response from the previous, canceled command. From that point on, the connection will remain in this weird, off-by-1 state.
Here's a script reproducing the problem:
Running this against a server in the cloud (such that requests typically take > 5ms to complete) results in this:
I believe the solution is simple. This method needs to be modified to disconnect connection when current request is canceled. For example, do this:
The text was updated successfully, but these errors were encountered: