diff options
author | Justin Clarke Casey | 2009-03-09 17:55:08 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-03-09 17:55:08 +0000 |
commit | 5a6bc26600c80d8e838bafdde4df970841c6c285 (patch) | |
tree | e85ab9419eb14c03601b02abfb455ee46e5d671e /OpenSim | |
parent | * Added TXXX in front of unit tests to make sure they are running in the corr... (diff) | |
download | opensim-SC-5a6bc26600c80d8e838bafdde4df970841c6c285.zip opensim-SC-5a6bc26600c80d8e838bafdde4df970841c6c285.tar.gz opensim-SC-5a6bc26600c80d8e838bafdde4df970841c6c285.tar.bz2 opensim-SC-5a6bc26600c80d8e838bafdde4df970841c6c285.tar.xz |
* Address http://opensimulator.org/mantis/view.php?id=3207
* A saved archive now immediately expires the data in the asset cache that it used, rather than retaining all the assets (esp textures) in the cache.
* This is an imperfect solution. Ideally we would only expire the assets newly requested for the archive (not existing ones). But doing that would require a lot more
restructuring.
* I don't believe there are any locking issues due to the locking performed by the underlying memory cache, but please report any issues.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetCache.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | 10 |
2 files changed, 9 insertions, 6 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 800c997..30f7ddf 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -46,8 +46,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
46 | /// This class actually encapsulates two largely separate mechanisms. One mechanism fetches assets either | 46 | /// This class actually encapsulates two largely separate mechanisms. One mechanism fetches assets either |
47 | /// synchronously or async and passes the data back to the requester. The second mechanism fetches assets and | 47 | /// synchronously or async and passes the data back to the requester. The second mechanism fetches assets and |
48 | /// sends packetised data directly back to the client. The only point where they meet is AssetReceived() and | 48 | /// sends packetised data directly back to the client. The only point where they meet is AssetReceived() and |
49 | /// AssetNotFound(), which means they do share the same asset and texture caches.I agr | 49 | /// AssetNotFound(), which means they do share the same asset and texture caches. |
50 | |||
51 | public class AssetCache : IAssetCache | 50 | public class AssetCache : IAssetCache |
52 | { | 51 | { |
53 | 52 | ||
@@ -401,9 +400,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
401 | m_memcache.AddOrUpdate(assetInf.FullID, assetInf, TimeSpan.FromHours(24)); | 400 | m_memcache.AddOrUpdate(assetInf.FullID, assetInf, TimeSpan.FromHours(24)); |
402 | 401 | ||
403 | if (StatsManager.SimExtraStats != null) | 402 | if (StatsManager.SimExtraStats != null) |
404 | { | ||
405 | StatsManager.SimExtraStats.AddAsset(assetInf); | 403 | StatsManager.SimExtraStats.AddAsset(assetInf); |
406 | } | ||
407 | 404 | ||
408 | if (RequestedAssets.ContainsKey(assetInf.FullID)) | 405 | if (RequestedAssets.ContainsKey(assetInf.FullID)) |
409 | { | 406 | { |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 99ec9b4..076fbce 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -72,7 +72,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
72 | /// </summary> | 72 | /// </summary> |
73 | protected IAssetCache m_assetCache; | 73 | protected IAssetCache m_assetCache; |
74 | 74 | ||
75 | protected internal AssetsRequest(ICollection<UUID> uuids, IAssetCache assetCache, AssetsRequestCallback assetsRequestCallback) | 75 | protected internal AssetsRequest( |
76 | ICollection<UUID> uuids, IAssetCache assetCache, AssetsRequestCallback assetsRequestCallback) | ||
76 | { | 77 | { |
77 | m_uuids = uuids; | 78 | m_uuids = uuids; |
78 | m_assetsRequestCallback = assetsRequestCallback; | 79 | m_assetsRequestCallback = assetsRequestCallback; |
@@ -100,9 +101,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
100 | public void AssetRequestCallback(UUID assetID, AssetBase asset) | 101 | public void AssetRequestCallback(UUID assetID, AssetBase asset) |
101 | { | 102 | { |
102 | if (asset != null) | 103 | if (asset != null) |
103 | m_assets[assetID] = asset; | 104 | { |
105 | m_assetCache.ExpireAsset(assetID); | ||
106 | m_assets[assetID] = asset; | ||
107 | } | ||
104 | else | 108 | else |
109 | { | ||
105 | m_notFoundAssetUuids.Add(assetID); | 110 | m_notFoundAssetUuids.Add(assetID); |
111 | } | ||
106 | 112 | ||
107 | //m_log.DebugFormat( | 113 | //m_log.DebugFormat( |
108 | // "[ARCHIVER]: Received {0} assets and notification of {1} missing assets", m_assets.Count, m_notFoundAssetUuids.Count); | 114 | // "[ARCHIVER]: Received {0} assets and notification of {1} missing assets", m_assets.Count, m_notFoundAssetUuids.Count); |