Skip to content

Catch TimeoutError#635

Closed
bokolob wants to merge 4 commits into
miguelgrinberg:masterfrom
bokolob:redis_timeout_exception
Closed

Catch TimeoutError#635
bokolob wants to merge 4 commits into
miguelgrinberg:masterfrom
bokolob:redis_timeout_exception

Conversation

@bokolob

@bokolob bokolob commented Feb 10, 2021

Copy link
Copy Markdown

Some network problems could cause TimeoutError, but it isn't handled. Moreover, the thread dies silently without any attempts to recover.

The bug can be also reproduced by setting the socket timeout option in Redis URL.

Probably there are other exceptions that should be retried as well, e.g BusyLoadingError.

@miguelgrinberg

Copy link
Copy Markdown
Owner

Any idea what's the equivalent error for aioredis so that both are fixed in parity?

@miguelgrinberg miguelgrinberg self-assigned this Feb 10, 2021
@bokolob

bokolob commented Feb 10, 2021

Copy link
Copy Markdown
Author

No idea yet, I don't use async server :( It's unclear from the first glance and needs some investigation.

@bokolob

bokolob commented Feb 15, 2021

Copy link
Copy Markdown
Author

By the way - It's very upsetting when thread dies, and the rest of the application continues to live. I'd fix that - register a callback to call if thread stop, or crash the whole app (in flask-socketio case)

@roymiloh

Copy link
Copy Markdown

Hi @miguelgrinberg! I’m noticing an increase in the number of Redis connections (I’d expect a single connection per instance), and I suspect it might be related to this issue. I saw your commit - since RedisError isn’t necessarily a connection issue, it seems possible that new connections keep getting opened while the old ones remain active. Before I work on a fix, does it make sense to you?

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 this pull request may close these issues.

3 participants