aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
diff options
context:
space:
mode:
authorUbitUmarov2017-06-22 21:37:51 +0100
committerUbitUmarov2017-06-22 21:37:51 +0100
commitaea49070c96b04d0f5e2496c14d32c1b1341b06f (patch)
tree11e5a550cb17fc041def167c106a205fd43d28fc /OpenSim/Region/Framework/Scenes/UuidGatherer.cs
parent split some asset uuids gather i stages with dif possible errors, and dont le... (diff)
downloadopensim-SC_OLD-aea49070c96b04d0f5e2496c14d32c1b1341b06f.zip
opensim-SC_OLD-aea49070c96b04d0f5e2496c14d32c1b1341b06f.tar.gz
opensim-SC_OLD-aea49070c96b04d0f5e2496c14d32c1b1341b06f.tar.bz2
opensim-SC_OLD-aea49070c96b04d0f5e2496c14d32c1b1341b06f.tar.xz
change uuidgather a bit more
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/UuidGatherer.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/UuidGatherer.cs48
1 files changed, 32 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index 3ba67eb..3a71c12 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -65,6 +65,7 @@ namespace OpenSim.Region.Framework.Scenes
65 /// </summary> 65 /// </summary>
66 /// <value>The gathered uuids.</value> 66 /// <value>The gathered uuids.</value>
67 public IDictionary<UUID, sbyte> GatheredUuids { get; private set; } 67 public IDictionary<UUID, sbyte> GatheredUuids { get; private set; }
68 public HashSet<UUID> FailedUUIDs { get; private set; }
68 69
69 /// <summary> 70 /// <summary>
70 /// Gets the next UUID to inspect. 71 /// Gets the next UUID to inspect.
@@ -111,6 +112,7 @@ namespace OpenSim.Region.Framework.Scenes
111 112
112 // FIXME: Not efficient for searching, can improve. 113 // FIXME: Not efficient for searching, can improve.
113 m_assetUuidsToInspect = new Queue<UUID>(); 114 m_assetUuidsToInspect = new Queue<UUID>();
115 FailedUUIDs = new HashSet<UUID>();
114 } 116 }
115 117
116 /// <summary> 118 /// <summary>
@@ -120,6 +122,10 @@ namespace OpenSim.Region.Framework.Scenes
120 /// <param name="uuid">UUID.</param> 122 /// <param name="uuid">UUID.</param>
121 public bool AddForInspection(UUID uuid) 123 public bool AddForInspection(UUID uuid)
122 { 124 {
125 if(FailedUUIDs.Contains(uuid))
126 return false;
127 if(GatheredUuids.ContainsKey(uuid))
128 return false;
123 if (m_assetUuidsToInspect.Contains(uuid)) 129 if (m_assetUuidsToInspect.Contains(uuid))
124 return false; 130 return false;
125 131
@@ -209,9 +215,7 @@ namespace OpenSim.Region.Framework.Scenes
209 // m_log.DebugFormat( 215 // m_log.DebugFormat(
210 // "[ARCHIVER]: Analysing item {0} asset type {1} in {2} {3}", 216 // "[ARCHIVER]: Analysing item {0} asset type {1} in {2} {3}",
211 // tii.Name, tii.Type, part.Name, part.UUID); 217 // tii.Name, tii.Type, part.Name, part.UUID);
212 218 AddForInspection(tii.AssetID, (sbyte)tii.Type);
213 if (!GatheredUuids.ContainsKey(tii.AssetID))
214 AddForInspection(tii.AssetID, (sbyte)tii.Type);
215 } 219 }
216 220
217 // FIXME: We need to make gathering modular but we cannot yet, since gatherers are not guaranteed 221 // FIXME: We need to make gathering modular but we cannot yet, since gatherers are not guaranteed
@@ -280,9 +284,15 @@ namespace OpenSim.Region.Framework.Scenes
280 /// <param name="assetUuid">The uuid of the asset for which to gather referenced assets</param> 284 /// <param name="assetUuid">The uuid of the asset for which to gather referenced assets</param>
281 private void GetAssetUuids(UUID assetUuid) 285 private void GetAssetUuids(UUID assetUuid)
282 { 286 {
287 if(FailedUUIDs.Contains(assetUuid))
288 return;
289
283 // avoid infinite loops 290 // avoid infinite loops
284 if (GatheredUuids.ContainsKey(assetUuid)) 291 if (GatheredUuids.ContainsKey(assetUuid))
292 {
293 FailedUUIDs.Add(assetUuid);
285 return; 294 return;
295 }
286 296
287 AssetBase assetBase; 297 AssetBase assetBase;
288 try 298 try
@@ -291,21 +301,28 @@ namespace OpenSim.Region.Framework.Scenes
291 } 301 }
292 catch (Exception e) 302 catch (Exception e)
293 { 303 {
294 m_log.ErrorFormat("[UUID GATHERER]: Failed to get asset id {0} : {1}", assetUuid, e.Message); 304 m_log.ErrorFormat("[UUID GATHERER]: Failed to get asset with id {0} : {1}", assetUuid, e.Message);
295 GatheredUuids.Remove(assetUuid); 305 FailedUUIDs.Add(assetUuid);
296 return; 306 return;
297 } 307 }
298 308
299 if(assetBase == null) 309 if(assetBase == null)
300 { 310 {
301 m_log.ErrorFormat("[UUID GATHERER]: asset id {0} not found", assetUuid); 311 m_log.ErrorFormat("[UUID GATHERER]: asset with id {0} not found", assetUuid);
302 GatheredUuids.Remove(assetUuid); 312 FailedUUIDs.Add(assetUuid);
303 return; 313 return;
304 } 314 }
305 315
306 sbyte assetType = assetBase.Type; 316 sbyte assetType = assetBase.Type;
307 GatheredUuids[assetUuid] = assetType;
308 317
318 if(assetBase.Data == null || assetBase.Data.Length == 0)
319 {
320 m_log.ErrorFormat("[UUID GATHERER]: asset with id {0} type {1} has no data", assetUuid, assetType);
321 FailedUUIDs.Add(assetUuid);
322 return;
323 }
324
325 GatheredUuids[assetUuid] = assetType;
309 try 326 try
310 { 327 {
311 if ((sbyte)AssetType.Bodypart == assetType || (sbyte)AssetType.Clothing == assetType) 328 if ((sbyte)AssetType.Bodypart == assetType || (sbyte)AssetType.Clothing == assetType)
@@ -335,13 +352,19 @@ namespace OpenSim.Region.Framework.Scenes
335 } 352 }
336 catch (Exception e) 353 catch (Exception e)
337 { 354 {
338 m_log.ErrorFormat("[UUID GATHERER]: Failed to uuids for asset id {0} type {1}: {2}", assetUuid, assetType, e.Message); 355 m_log.ErrorFormat("[UUID GATHERER]: Failed to gather uuids for asset with id {0} type {1}: {2}", assetUuid, assetType, e.Message);
356 GatheredUuids.Remove(assetUuid);
357 FailedUUIDs.Add(assetUuid);
339 } 358 }
340 } 359 }
341 360
342 private void AddForInspection(UUID assetUuid, sbyte assetType) 361 private void AddForInspection(UUID assetUuid, sbyte assetType)
343 { 362 {
344 // Here, we want to collect uuids which require further asset fetches but mark the others as gathered 363 // Here, we want to collect uuids which require further asset fetches but mark the others as gathered
364 if(FailedUUIDs.Contains(assetUuid))
365 return;
366 if(GatheredUuids.ContainsKey(assetUuid))
367 return;
345 try 368 try
346 { 369 {
347 if ((sbyte)AssetType.Bodypart == assetType 370 if ((sbyte)AssetType.Bodypart == assetType
@@ -504,13 +527,6 @@ namespace OpenSim.Region.Framework.Scenes
504 /// <param name="sceneObjectAsset"></param> 527 /// <param name="sceneObjectAsset"></param>
505 private void RecordSceneObjectAssetUuids(AssetBase sceneObjectAsset) 528 private void RecordSceneObjectAssetUuids(AssetBase sceneObjectAsset)
506 { 529 {
507 if(sceneObjectAsset.Data == null || sceneObjectAsset.Data.Length == 0)
508 {
509 m_log.WarnFormat("[UUIDgatherer] Error: object asset '{0}' id: {1} has no data",
510 sceneObjectAsset.Name,sceneObjectAsset.ID.ToString());
511 return;
512 }
513
514 string xml = Utils.BytesToString(sceneObjectAsset.Data); 530 string xml = Utils.BytesToString(sceneObjectAsset.Data);
515 531
516 CoalescedSceneObjects coa; 532 CoalescedSceneObjects coa;