diff options
author | Justin Clarke Casey | 2008-11-11 17:54:21 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-11 17:54:21 +0000 |
commit | 50e3eb31b0c2479e0fa7511aff879426b893a35d (patch) | |
tree | e91f1863126ad1d67f29dc97ec3456c34d79e910 /OpenSim | |
parent | * Minor typing fixes in AssetCache - now uses base types for nearly everything. (diff) | |
download | opensim-SC-50e3eb31b0c2479e0fa7511aff879426b893a35d.zip opensim-SC-50e3eb31b0c2479e0fa7511aff879426b893a35d.tar.gz opensim-SC-50e3eb31b0c2479e0fa7511aff879426b893a35d.tar.bz2 opensim-SC-50e3eb31b0c2479e0fa7511aff879426b893a35d.tar.xz |
* Restore storing null to represent 'missing asset' requests in the AssetCache
* If we don't do this then callers to the polling GetAsset wait the full polling time before returning
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetCache.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index fe25eca..9945829 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -245,15 +245,13 @@ namespace OpenSim.Framework.Communications.Cache | |||
245 | /// <summary> | 245 | /// <summary> |
246 | /// Synchronously retreive an asset. If the asset isn't in the cache, a request will be made to the persistent store to | 246 | /// Synchronously retreive an asset. If the asset isn't in the cache, a request will be made to the persistent store to |
247 | /// load it into the cache. | 247 | /// load it into the cache. |
248 | /// </summary> | ||
248 | /// | 249 | /// |
249 | /// XXX We'll keep polling the cache until we get the asset or we exceed | 250 | /// XXX We'll keep polling the cache until we get the asset or we exceed |
250 | /// the allowed number of polls. This isn't a very good way of doing things since a single thread | 251 | /// the allowed number of polls. This isn't a very good way of doing things since a single thread |
251 | /// is processing inbound packets, so if the asset server is slow, we could block this for up to | 252 | /// is processing inbound packets, so if the asset server is slow, we could block this for up to |
252 | /// the timeout period. What we might want to do is register asynchronous callbacks on asset | 253 | /// the timeout period. Whereever possible we want to use the asynchronous callback GetAsset() |
253 | /// receipt in the same manner as the TextureDownloadModule. Of course, | 254 | /// |
254 | /// a timeout before asset receipt usually isn't fatal, the operation will work on the retry when the | ||
255 | /// asset is much more likely to have made it into the cache. | ||
256 | /// </summary> | ||
257 | /// <param name="assetID"></param> | 255 | /// <param name="assetID"></param> |
258 | /// <param name="isTexture"></param> | 256 | /// <param name="isTexture"></param> |
259 | /// <returns>null if the asset could not be retrieved</returns> | 257 | /// <returns>null if the asset could not be retrieved</returns> |
@@ -270,6 +268,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
270 | { | 268 | { |
271 | return asset; | 269 | return asset; |
272 | } | 270 | } |
271 | |||
273 | m_assetServer.RequestAsset(assetID, isTexture); | 272 | m_assetServer.RequestAsset(assetID, isTexture); |
274 | 273 | ||
275 | do | 274 | do |
@@ -280,7 +279,8 @@ namespace OpenSim.Framework.Communications.Cache | |||
280 | { | 279 | { |
281 | return asset; | 280 | return asset; |
282 | } | 281 | } |
283 | } while (--maxPolls > 0); | 282 | } |
283 | while (--maxPolls > 0); | ||
284 | 284 | ||
285 | m_log.WarnFormat("[ASSET CACHE]: {0} {1} was not received before the retrieval timeout was reached", | 285 | m_log.WarnFormat("[ASSET CACHE]: {0} {1} was not received before the retrieval timeout was reached", |
286 | isTexture ? "texture" : "asset", assetID.ToString()); | 286 | isTexture ? "texture" : "asset", assetID.ToString()); |
@@ -400,6 +400,9 @@ namespace OpenSim.Framework.Communications.Cache | |||
400 | { | 400 | { |
401 | // m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID); | 401 | // m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID); |
402 | 402 | ||
403 | // Remember the fact that this asset could not be found to prevent delays from repeated requests | ||
404 | m_memcache.Add(assetID, null, TimeSpan.FromHours(24)); | ||
405 | |||
403 | // Notify requesters for this asset | 406 | // Notify requesters for this asset |
404 | AssetRequestsList reqList; | 407 | AssetRequestsList reqList; |
405 | lock (RequestLists) | 408 | lock (RequestLists) |