#35120 closed Bug (needsinfo)

Stack overflow in render method when many instances of included template

Reported by: Morgan10E Owned by: nobody
Component: Template system Version: 4.1
Severity: Normal Keywords: render template include
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

To reproduce behavior:

  1. Create a base template
  2. Create a template to include. It does not matter what the contents are
  3. Force included template to be included thousands of times
  4. See "error_no_response" on client

On the server, we were able to observe through print statements that everything up to the render call was executing as expected. However, there was no error to indicate what might be going wrong. We narrowed down the likely culprit to stack overflow via the following observations:

  1. If you put the contents of the included template directly in the base template, the issue does not occur and the page renders as expected
  2. If you reduce the number of instances of the include, the issue does not occur and the page renders as expected

The desired behavior would be to at least surface some type of actionable error message.

Change History (1)

comment:1 by Mariusz Felisiak, 10 months ago

Resolution: needsinfo
Status: newclosed

Hi, I don't think you've explained the issue in enough detail to confirm a bug in Django. Please reopen the ticket if you can debug your issue and provide details about why and where Django is at fault. A sample project that reproduces the issue may also be helpful.

  1. Force included template to be included thousands of times

Are you doing experiments? or this is a real-life scenario.

Note: See TracTickets for help on using tickets.
Back to Top