X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FCache%2FCacheCollector.php;h=b0c9f45b1923ab2e78fd511288614c1f4ff567f1;hp=acbbf006a05aa57e189e245c74091ff14675f116;hb=bfbba508964731508b9bd6d5835c2edc858db95b;hpb=cb9a80db11fc6b014e5b1e693a5a391c95eb5d9a diff --git a/web/core/lib/Drupal/Core/Cache/CacheCollector.php b/web/core/lib/Drupal/Core/Cache/CacheCollector.php index acbbf006a..b0c9f45b1 100644 --- a/web/core/lib/Drupal/Core/Cache/CacheCollector.php +++ b/web/core/lib/Drupal/Core/Cache/CacheCollector.php @@ -246,6 +246,18 @@ abstract class CacheCollector implements CacheCollectorInterface, DestructableIn } $data = array_merge($cache->data, $data); } + elseif ($this->cacheCreated) { + // Getting here indicates that there was a cache entry at the + // beginning of the request, but now it's gone (some other process + // must have cleared it). We back out to prevent corrupting the cache + // with incomplete data, since we won't be able to properly merge + // the existing cache data from earlier with the new data. + // A future request will properly hydrate the cache from scratch. + if ($lock) { + $this->lock->release($lock_name); + } + return; + } // Remove keys marked for deletion. foreach ($this->keysToRemove as $delete_key) { unset($data[$delete_key]);