Add tests for race conditions in Twig template cache

Created on 28 July 2015, about 10 years ago
Updated 22 August 2025, about 2 months ago

Problem/Motivation

In #2429659: Race conditions in the twig template cache β†’ , a Twig template cache race condition was found, which caused some sites, in some circumstances, to have fatal errors that required manual cache clearing or other specialized fixes.

Most of the ways to reproduce the bug involve extensive/elaborate manual process, and while there was one simple automated test added, it didn't thoroughly reproduce scenarios that can lead to the Twig template race condition, e.g.:

  • High traffic site with multiple PHP-FPM processes that end up not writing the Twig template file correctly.
  • Shared / slow filesystems for generated Twig template storage, causing the fatal error on first page load (but it clears on on second page load).
  • Other mysterious occurrences which are not well understood... but happened nonetheless!

Proposed resolution

Write some tests to test for the race condition in the Twig template cache.

Remaining tasks

Write tests.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

theme system

Created by

πŸ‡ΊπŸ‡ΈUnited States geerlingguy

Live updates comments and jobs are added and updated live.
  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024