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

connection.can_read() raises OSError when connection is broken #2138

Closed
kristjanvalur opened this issue Apr 25, 2022 · 0 comments · Fixed by #2140
Closed

connection.can_read() raises OSError when connection is broken #2138

kristjanvalur opened this issue Apr 25, 2022 · 0 comments · Fixed by #2140

Comments

@kristjanvalur
Copy link
Contributor

Version: 4.2.2

Platform: Windows 11
Description:
redis.asyncio.connection.Connection(), the class provides a can_read method, which is used, for example, in Client.parse_response.

However, unlike Connection.read_response() there is no error handling present to turn any OSErrors into asyncio.ConnectionError.
And so, the OSError bubbles up and causes problems, where we expect only asyncio.ConnectionError to occur.
This plays havoc with retry-mechanisms and automatic reconnect.

The issue is evident when the connection to the redis server is interrupted during a blocking call to pubsub.run() where a get_message call is made with a positive timeout.

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

Successfully merging a pull request may close this issue.

1 participant