-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Connections can end up in inconsistent state due to except Exception: instead of bare except: #360
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
Comments
The problem with the empty except causes is that they swallow KeyboardInterrupt exceptions. This means you can't kill a script that's blocked (likely in a socket call) via ctrl-c / ctrl-break. See #328 for where this change was made. Do you know why the gevent example breaks? Is there a gevent exception that's being raised that's not inherited from the base Exception class? |
Yes, gevent raises Timeout, which is not derived from Exception. The code I'm suggesting changing back to bare |
Alright, I think this is correct since the exception gets re-raised anyway. Fixed in 80baa99 |
The changelog for 2.7.3 mentions all bare
except:
s have been changed toexcept Exception:
. Unfortunately, this can sometimes cause connections to be released to the pool in an inconsistent state.Here's a script that demonstrates the problem using gevent timeouts: https://gist.github.com/leifkb/5871666 And a patch: https://gist.github.com/leifkb/5871691
The text was updated successfully, but these errors were encountered: