rasky/geventconnpool — pull request #1 by spang (2014-05-30 18:01:06+00:00)
Title: add features to retry decorator and allow customization of discard-triggering exceptions

Hi there!

First of all, thanks for writing `geventconnpool`. It's a nifty little library which we've found really useful.

We've run into a few limitations, however, and this patch is meant to address them. It adds support for:
* Customizing which exception classes trigger connection discards. Unfortunately, even some stdlib modules (such as imaplib) use classes which do not derive from `socket.error` for network-related exceptions. Allowing callers to customize which classes trigger discards provides flexibility without monkeypatching.
* Logging in `@retry`. Our app is big enough that silent retries are pretty terrifying and really hard to debug. Disabled-by-default logging with customizeable messages fixes this.
* Wait periods between retries and max retry attempts. Invaluable features for real-world applications.

I hope you'll consider taking these patches. They shouldn't affect existing users at all, and provide a lot more flexibility. Note that I've only tested them on Python 2.7; I'm not sure which versions `geventconnpool` targets supporting.