Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#34167 closed Cleanup/optimization (wontfix)

Set a reasonable default for EMAIL_TIMEOUT

Reported by: Federico Capoano Owned by: nobody
Component: Core (Mail) Version: 4.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Federico Capoano)

Why there's no default for EMAIL_TIMEOUT?

Applications built in Django can potentially stall indefinitely if email
sending starts to hang (eg: if the SMTP server is overloaded), when this
happens, since there's no timeout, there's also no error being logged, so
it's very hard and time consuming to debug.

Wouldn't it be better to set a timeout? Some high value like 2 minutes
which wouldn't really make sense to wait any longer, so at least if and
when this happens, developers will find error traces in the logs and
quickly understand where the problem is coming from, instead of spending
hours to debug it like I did in the past week.

Change History (3)

comment:1 by Mariusz Felisiak, 2 years ago

Resolution: wontfix
Status: newclosed

Why there's no default for EMAIL_TIMEOUT?

If timeout is unspecified, SMTP backend will use socket.getdefaulttimeout(), so adding a default value for EMAIL_TIMEOUT would be backward incompatible for all projects that set a default timeout for sockets.

Initially closing as "wontfix". Please first start a discussion on the DevelopersMailingList., where you'll reach a wider audience and see what other think, and follow triaging guidelines with regards to wontfix tickets. If you can get consensus on a proposal on the DevelopersMailingList, we can reopen the ticket. Thanks!

comment:2 by Federico Capoano, 2 years ago

Description: modified (diff)

For the record, I started a discussion in the Django Developers Mailing List: https://groups.google.com/g/django-developers/c/XZbKeM8fVxU/m/jp0h8U4tBgAJ .

comment:3 by Federico Capoano, 2 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top