-
Notifications
You must be signed in to change notification settings - Fork 139
Description
We recently had networking troubles which lead to certain (Sendgrid) SSL handshakes stalling forever. This lead all our mail sending workers to eventually stall and lock up all background tasks.
Usually, for other HTTPS requests, we add a (generous) timeout (see http://docs.python-requests.org/en/master/user/quickstart/#timeouts). The timeout is chosen such that it only triggers in those rare, extreme circumstances. We mostly use 30 seconds, but Stripe, as another example, uses even 80 seconds (https://github.com/stripe/stripe-python/blob/f948b8b95b6df5b57c7444a05d6c83c8c5e6a0ac/stripe/http_client.py#L97).
I think anymail should have a default timeout, too. Doesn't even have to be configurable, and the exception could be passed straight to user code.