Django's usage of smtplib.SMTP should have a timeout
|Reported by:||André Cruz||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
When EmailBackend initializes SMTP objects it does not provide a timeout, and the default timeout is object() (no timeout). It would be sensible to provide some configurable timeout.
I've got bitten by this when using the AdminEmailHandler. My database went down, a lot of exceptions were generated and Django was trying to send emails. The SMTP server started not responding and the requests started blocking, until all my workers were used up. By then Django stopped serving requests. Basically, I was DoSed by my own SMTP server.
Change History (11)
comment:2 Changed 3 years ago by
|Triage Stage:||Unreviewed → Accepted|
|Type:||Bug → Cleanup/optimization|