Django's usage of smtplib.SMTP should have a timeout
|Reported by:||edevil||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:1 Changed 18 months ago by edevil
- Easy pickings set
- Has patch set
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 Changed 18 months ago by claudep
- Triage Stage changed from Unreviewed to Accepted
- Type changed from Bug to Cleanup/optimization