From 2ec34580ce3807cede97539488237040e1a8a6cc Mon Sep 17 00:00:00 2001 From: BlueWall Date: Fri, 7 Sep 2012 10:13:51 -0400 Subject: Move addin information to CoreModulePlugin.addin.xml Move the addin information from attributes in the source file to the CoreModulePlugin.xml, which is the standard. This will help us automate addin version dependency information when we make new OpenSim releases. --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index fab489d..4bce416 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -49,12 +49,8 @@ using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; -[assembly: Addin("FlotsamAssetCache", "1.1")] -[assembly: AddinDependency("OpenSim", "0.5")] - -namespace Flotsam.RegionModules.AssetCache +namespace OpenSim.Region.CoreModules.Asset { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class FlotsamAssetCache : ISharedRegionModule, IImprovedAssetCache, IAssetService { private static readonly ILog m_log = -- cgit v1.1 From 8321ecb7a26f443a0f137457da5b6e780a824c6c Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sun, 9 Sep 2012 13:50:44 -0400 Subject: Revert "Move addin information to CoreModulePlugin.addin.xml" This reverts commit 2ec34580ce3807cede97539488237040e1a8a6cc. Moving the attributes for mono addins back to the source file - this also fixes http://opensimulator.org/mantis/view.php?id=6278. --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 4bce416..fab489d 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -49,8 +49,12 @@ using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; -namespace OpenSim.Region.CoreModules.Asset +[assembly: Addin("FlotsamAssetCache", "1.1")] +[assembly: AddinDependency("OpenSim", "0.5")] + +namespace Flotsam.RegionModules.AssetCache { + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class FlotsamAssetCache : ISharedRegionModule, IImprovedAssetCache, IAssetService { private static readonly ILog m_log = -- cgit v1.1 From bf56b30024f9ee945bba2836dcd9d092ed71330b Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sun, 9 Sep 2012 14:30:59 -0400 Subject: Adjust namespce of FlotsamCache Place FloatsamCache in the same namespace as our other core asset caches --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index fab489d..5d8a278 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -52,7 +52,7 @@ using OpenSim.Services.Interfaces; [assembly: Addin("FlotsamAssetCache", "1.1")] [assembly: AddinDependency("OpenSim", "0.5")] -namespace Flotsam.RegionModules.AssetCache +namespace OpenSim.Region.CoreModules.Asset { [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class FlotsamAssetCache : ISharedRegionModule, IImprovedAssetCache, IAssetService -- cgit v1.1 From d5c8c6bc12d434bb6a4bbc6f326a4ae784c12861 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 15 Sep 2012 01:08:15 +0100 Subject: For FlotsamAssetCache, always update access times of cached scene assets before looking for files to expire. This is to resolve a problem where an asset marked as local but not temporary but still used in the scene would be removed. The timed expiry scan no longer tries to refetch assets from the scene that are not currently in the cache - this is not helpful since it just drags a lot of data into the cache that may never be referenced. This removes the DeepScanBeforePurge option since setting this to false will introduce the above problem. This previously had a default of true. --- .../Region/CoreModules/Asset/FlotsamAssetCache.cs | 37 ++++++++++------------ 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 5d8a278..8aa173a 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -107,8 +107,6 @@ namespace OpenSim.Region.CoreModules.Asset private IAssetService m_AssetService; private List m_Scenes = new List(); - private bool m_DeepScanBeforePurge; - public FlotsamAssetCache() { m_InvalidChars.AddRange(Path.GetInvalidPathChars()); @@ -170,8 +168,6 @@ namespace OpenSim.Region.CoreModules.Asset m_CacheDirectoryTierLen = assetConfig.GetInt("CacheDirectoryTierLength", m_CacheDirectoryTierLen); m_CacheWarnAt = assetConfig.GetInt("CacheWarnAt", m_CacheWarnAt); - - m_DeepScanBeforePurge = assetConfig.GetBoolean("DeepScanBeforePurge", m_DeepScanBeforePurge); } m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Cache Directory {0}", m_CacheDirectory); @@ -506,13 +502,10 @@ namespace OpenSim.Region.CoreModules.Asset // Purge all files last accessed prior to this point DateTime purgeLine = DateTime.Now - m_FileExpiration; - // An optional deep scan at this point will ensure assets present in scenes, - // or referenced by objects in the scene, but not recently accessed - // are not purged. - if (m_DeepScanBeforePurge) - { - CacheScenes(); - } + // An asset cache may contain local non-temporary assets that are not in the asset service. Therefore, + // before cleaning up expired files we must scan the objects in the scene to make sure that we retain + // such local assets if they have not been recently accessed. + TouchAllSceneAssets(false); foreach (string dir in Directory.GetDirectories(m_CacheDirectory)) { @@ -705,11 +698,14 @@ namespace OpenSim.Region.CoreModules.Asset /// /// Iterates through all Scenes, doing a deep scan through assets - /// to cache all assets present in the scene or referenced by assets - /// in the scene + /// to update the access time of all assets present in the scene or referenced by assets + /// in the scene. /// - /// - private int CacheScenes() + /// + /// If true, then assets scanned which are not found in cache are added to the cache. + /// + /// Number of distinct asset references found in the scene. + private int TouchAllSceneAssets(bool storeUncached) { UuidGatherer gatherer = new UuidGatherer(m_AssetService); @@ -732,7 +728,7 @@ namespace OpenSim.Region.CoreModules.Asset { File.SetLastAccessTime(filename, DateTime.Now); } - else + else if (storeUncached) { m_AssetService.Get(assetID.ToString()); } @@ -860,13 +856,14 @@ namespace OpenSim.Region.CoreModules.Asset break; - case "assets": - m_log.Info("[FLOTSAM ASSET CACHE]: Caching all assets, in all scenes."); + m_log.Info("[FLOTSAM ASSET CACHE]: Ensuring assets are cached for all scenes."); Util.FireAndForget(delegate { - int assetsCached = CacheScenes(); - m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Completed Scene Caching, {0} assets found.", assetsCached); + int assetReferenceTotal = TouchAllSceneAssets(true); + m_log.InfoFormat( + "[FLOTSAM ASSET CACHE]: Completed check with {0} assets.", + assetReferenceTotal); }); break; -- cgit v1.1 From 5fb5758103c46de2abbc50b6503706eadcd37bfd Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 10 Nov 2012 15:54:11 -0800 Subject: Cleaning up some confusion with Addin names introduced in a prior commit. Also the Flotsam cache module was being given a different Addin name, I removed that. --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 8aa173a..b77bc59 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -49,8 +49,8 @@ using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; -[assembly: Addin("FlotsamAssetCache", "1.1")] -[assembly: AddinDependency("OpenSim", "0.5")] +//[assembly: Addin("FlotsamAssetCache", "1.1")] +//[assembly: AddinDependency("OpenSim", "0.5")] namespace OpenSim.Region.CoreModules.Asset { -- cgit v1.1 From 86903f23dd9c0e671fcc9854c031bcc0c6d6cc7f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 12 Nov 2012 18:08:02 -0800 Subject: Cleanup on region modules: gave short node id's to all of them. --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index b77bc59..232d9f5 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -54,7 +54,7 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Asset { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "FlotsamAssetCache")] public class FlotsamAssetCache : ISharedRegionModule, IImprovedAssetCache, IAssetService { private static readonly ILog m_log = -- cgit v1.1 From c88e6fb44505ff5530b2723665f81a232eb630ad Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 14 Nov 2012 07:50:19 -0800 Subject: Possibly fixes mantis #6429 (Flotsam cache having a null ref to the asset service) --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 232d9f5..8e800cb 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -222,10 +222,6 @@ namespace OpenSim.Region.CoreModules.Asset scene.RegisterModuleInterface(this); m_Scenes.Add(scene); - if (m_AssetService == null) - { - m_AssetService = scene.RequestModuleInterface(); - } } } @@ -240,6 +236,8 @@ namespace OpenSim.Region.CoreModules.Asset public void RegionLoaded(Scene scene) { + if (m_Enabled && m_AssetService == null) + m_AssetService = scene.RequestModuleInterface(); } //////////////////////////////////////////////////////////// -- cgit v1.1