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

Files: 
CommentFileSizeAuthor
#1 add_tests_for_race-2541440-1.patch1.27 KBgeerlingguy
PASSED: [[SimpleTest]]: [PHP 5.5 MySQL] 99,820 pass(es). View

Comments

geerlingguy’s picture

Status: Active » Needs review
FileSize
1.27 KB
PASSED: [[SimpleTest]]: [PHP 5.5 MySQL] 99,820 pass(es). View

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

alexpott’s picture

But the test is not failing on it's own?

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

lauriii’s picture

Status: Needs review » Needs work

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.