From 40e656de46d1a6e14d44d1ba555f50c6534e9c59 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 31 Oct 2019 16:27:34 +1100 Subject: [PATCH] notes --- .../PublishedCache/NuCache/PublishedSnapshotService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs index 276498ec93..533c13a992 100755 --- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs @@ -402,7 +402,7 @@ namespace Umbraco.Web.PublishedCache.NuCache if (kits.Count == 0) { // If there's nothing in the local cache file, we should return false? YES even though the site legitately might be empty. - // Is it possible that the cache file is empty but the database is not? YES... + // Is it possible that the cache file is empty but the database is not? YES... (well, it used to be possible) // * A new file is created when one doesn't exist, this will only be done when MainDom is acquired // * The new file will be populated as soon as LoadCachesOnStartup is called // * If the appdomain is going down the moment after MainDom was acquired and we've created an empty cache file, @@ -413,6 +413,9 @@ namespace Umbraco.Web.PublishedCache.NuCache // loaded by the next appdomain and it won't check if it's empty, it just assumes that since the cache // file is there, that is correct. + // Update: We will still return false here even though the above mentioned race condition has been fixed since we now + // lock the entire operation of creating/populating the cache file with the same lock as releasing/closing the cache file + _logger.Info("Tried to load content from the local cache file but it was empty."); return false; }