[Django] #34159: Django potential improvement - views decorator for http_timeout with auto retry

6 views
Skip to first unread message

Django

unread,
Nov 15, 2022, 3:01:19 AM11/15/22
to django-...@googlegroups.com
#34159: Django potential improvement - views decorator for http_timeout with auto
retry
-------------------------------------+-------------------------------------
Reporter: JDonMc | Owner: nobody
Type: New | Status: new
feature |
Component: HTTP | Version: 4.1
handling | Keywords: views decorator
Severity: Normal | timeout
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-------------------------------------+-------------------------------------
Sometimes django views take 30+ seconds to load, and then timeout.

The weird thing is, that you can refresh the page from a browser, and it
will load in less than a second.

Because it's non-deterministic, it's really hard to solve.

Ideally I'd set a timer so that any request that takes 4+ seconds to solve
is killed and retried,
and a secondary timer so that any request that has been retried 7 times
redirects to an error page,
on the error page implement some javascript to re-request the page.

I understand it's a bit much, but the first thing is important to me.
Most 99% of my requests are under 2 seconds,
but for some reason at random intervals it hits 30+ and sends an 503
error,
But it's non-deterministic because that same page can still be loaded
exactly the same within 2 seconds.

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

Django

unread,
Nov 15, 2022, 4:57:31 AM11/15/22
to django-...@googlegroups.com
#34159: Django potential improvement - views decorator for http_timeout with auto
retry
-------------------------------------+-------------------------------------
Reporter: JDonMc | Owner: nobody
Type: New feature | Status: closed
Component: HTTP handling | Version: 4.1
Severity: Normal | Resolution: wontfix
Keywords: views decorator | Triage Stage:
timeout | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

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


Comment:

> Ideally I'd set a timer so that any request that takes 4+ seconds to
solve is killed and retried,
and a secondary timer so that any request that has been retried 7 times
redirects to an error page,
on the error page implement some javascript to re-request the page.

I think this would work well as a third-party app. Certainly prototyping
it there would be appropriate, following up on the DevelopersMailingList
to discuss inclusion at that point.

For the simpler case, perhaps a [https://adamj.eu/tech/2019/05/27/the-
simplest-wsgi-middleware/ WSGI Middleware] would be the easiest thing to
add?

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

Reply all
Reply to author
Forward
0 new messages