[Django] #34167: Set a reasonable default for EMAIL_TIMEOUT

3 views
Skip to first unread message

Django

unread,
Nov 16, 2022, 11:56:01 AM11/16/22
to django-...@googlegroups.com
#34167: Set a reasonable default for EMAIL_TIMEOUT
------------------------------------------------+------------------------
Reporter: Federico Capoano | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Mail) | Version: 4.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/34167>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 16, 2022, 11:50:27 PM11/16/22
to django-...@googlegroups.com
#34167: Set a reasonable default for EMAIL_TIMEOUT
-------------------------------------+-------------------------------------

Reporter: Federico Capoano | Owner: nobody
Type: | Status: closed
Cleanup/optimization |

Component: Core (Mail) | Version: 4.1
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => wontfix


Comment:

> Why there's no default for `EMAIL_TIMEOUT`?

If timeout is unspecified,
[https://docs.djangoproject.com/en/stable/topics/email/#smtp-backend 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
[https://docs.djangoproject.com/en/stable/internals/contributing/triaging-
tickets/#closing-tickets 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!

--
Ticket URL: <https://code.djangoproject.com/ticket/34167#comment:1>

Django

unread,
Nov 21, 2022, 8:01:42 AM11/21/22
to django-...@googlegroups.com
#34167: Set a reasonable default for EMAIL_TIMEOUT
-------------------------------------+-------------------------------------
Reporter: Federico Capoano | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Core (Mail) | Version: 4.1
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Old description:

> 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.

New description:

For the record, I started a discussion here: https://groups.google.com/g
/django-developers/c/XZbKeM8fVxU/m/jp0h8U4tBgAJ

--

Comment (by Federico Capoano):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/34167#comment:2>

Django

unread,
Nov 21, 2022, 8:14:17 AM11/21/22
to django-...@googlegroups.com
#34167: Set a reasonable default for EMAIL_TIMEOUT
-------------------------------------+-------------------------------------
Reporter: Federico Capoano | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Core (Mail) | Version: 4.1
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Federico Capoano:

Old description:

> For the record, I started a discussion here: https://groups.google.com/g
> /django-developers/c/XZbKeM8fVxU/m/jp0h8U4tBgAJ

New description:

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.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/34167#comment:3>

Reply all
Reply to author
Forward
0 new messages