Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#1 | add_tests_for_race-2541440-1.patch | 1.27 KB | geerlingguy |
Comments
Comment #1
geerlingguy CreditAttribution: geerlingguy at Acquia commentedI'm attaching the tests-only patch from the end of #2429659: Race conditions in the twig template cache. Note that this didn't fully reproduce all the fatal-inducing scenarios, but it's a good start.
Comment #2
alexpottBut the test is not failing on it's own?
Comment #5
lauriii