Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

ConnectionError not handled correctly if there are no connections in the pool #453

Closed
FranGM opened this issue May 2, 2021 · 1 comment · Fixed by #454
Closed

ConnectionError not handled correctly if there are no connections in the pool #453

FranGM opened this issue May 2, 2021 · 1 comment · Fixed by #454

Comments

@FranGM
Copy link
Contributor

FranGM commented May 2, 2021

Hi there!

Recently we ran into an issue where it seems like we were not handling a ConnectionError correctly and tried to call connection.disconnect() (see here ) when connection had a None value, which results in an unhandled exception being raised.

Seems like if you're using ClusterBlockingConnectionPool, and time out before a connection is available a ConnectionError will get raised, which gets mishandled in this case. The rest of the error handling seems correct to me, so I'm going to submit a PR that just checks that connection is not None before attempting to disconnect, and I'll be happy to add any other stuff that you think might be missing.

FranGM pushed a commit to FranGM/redis-py-cluster that referenced this issue Jul 19, 2021
This is another case of
Grokzen#453

There are cases in which we can get a `BaseException` before we have
established a connection, which means that attempting to disconnect from
it will result in an unhandled exception.
@FranGM
Copy link
Contributor Author

FranGM commented Jul 19, 2021

I don't know if I can reopen issues but there's another instance of this issue with a fix here: #472

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant