diff options
author | UbitUmarov | 2017-06-24 02:01:48 +0100 |
---|---|---|
committer | UbitUmarov | 2017-06-24 02:01:48 +0100 |
commit | 191661b51d31254419e9b442ec12953772821ac3 (patch) | |
tree | 41e32cf5889e96e6284677809ca2230b8066fdad /OpenSim | |
parent | code actually has no ideia if a id is a asset or not and does try to handle ... (diff) | |
download | opensim-SC_OLD-191661b51d31254419e9b442ec12953772821ac3.zip opensim-SC_OLD-191661b51d31254419e9b442ec12953772821ac3.tar.gz opensim-SC_OLD-191661b51d31254419e9b442ec12953772821ac3.tar.bz2 opensim-SC_OLD-191661b51d31254419e9b442ec12953772821ac3.tar.xz |
a few more changes to iar/oar assets save error/warning to show problems known to be asset errors
Diffstat (limited to '')
3 files changed, 70 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index d816ba4..ad46107 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -223,10 +223,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
223 | if (SaveAssets && itemAssetType != AssetType.Link && itemAssetType != AssetType.LinkFolder) | 223 | if (SaveAssets && itemAssetType != AssetType.Link && itemAssetType != AssetType.LinkFolder) |
224 | { | 224 | { |
225 | int curErrorCntr = m_assetGatherer.ErrorCount; | 225 | int curErrorCntr = m_assetGatherer.ErrorCount; |
226 | int possible = m_assetGatherer.possibleNotAssetCount; | ||
226 | m_assetGatherer.AddForInspection(inventoryItem.AssetID); | 227 | m_assetGatherer.AddForInspection(inventoryItem.AssetID); |
227 | m_assetGatherer.GatherAll(); | 228 | m_assetGatherer.GatherAll(); |
228 | curErrorCntr = m_assetGatherer.ErrorCount - curErrorCntr; | 229 | curErrorCntr = m_assetGatherer.ErrorCount - curErrorCntr; |
229 | if(curErrorCntr > 0) | 230 | possible = m_assetGatherer.possibleNotAssetCount - possible; |
231 | |||
232 | if(curErrorCntr > 0 || possible > 0) | ||
230 | { | 233 | { |
231 | string spath; | 234 | string spath; |
232 | int indx = path.IndexOf("__"); | 235 | int indx = path.IndexOf("__"); |
@@ -235,15 +238,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
235 | else | 238 | else |
236 | spath = path; | 239 | spath = path; |
237 | 240 | ||
238 | if(curErrorCntr > 1) | 241 | if(curErrorCntr > 0) |
239 | { | 242 | { |
240 | m_log.WarnFormat("[INVENTORY ARCHIVER Warning]: item {0} '{1}', type {2}, in '{3}', contains {4} references to possible missing or damaged assets )", | 243 | m_log.ErrorFormat("[INVENTORY ARCHIVER Warning]: item {0} '{1}', type {2}, in '{3}', contains {4} references to missing or damaged assets", |
241 | inventoryItem.ID, inventoryItem.Name, itemAssetType.ToString(), spath, curErrorCntr); | 244 | inventoryItem.ID, inventoryItem.Name, itemAssetType.ToString(), spath, curErrorCntr); |
245 | if(possible > 0) | ||
246 | m_log.WarnFormat("[INVENTORY ARCHIVER Warning]: item also contains {0} references that may be to missing or damaged assets or not a problem", possible); | ||
242 | } | 247 | } |
243 | else if(curErrorCntr == 1) | 248 | else if(possible > 0) |
244 | { | 249 | { |
245 | m_log.WarnFormat("[INVENTORY ARCHIVER Warning]: item {0} '{1}', type {2}, in '{3}', contains a reference to a possible missing or damaged asset)", | 250 | m_log.WarnFormat("[INVENTORY ARCHIVER Warning]: item {0} '{1}', type {2}, in '{3}', contains {4} references that may be to missing or damaged assets or not a problem", inventoryItem.ID, inventoryItem.Name, itemAssetType.ToString(), spath, possible); |
246 | inventoryItem.ID, inventoryItem.Name, itemAssetType.ToString(), spath); | ||
247 | } | 251 | } |
248 | } | 252 | } |
249 | } | 253 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs index 0ed3399..11c53d7 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs | |||
@@ -182,11 +182,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
182 | 182 | ||
183 | Dictionary<UUID, sbyte> assetUuids = new Dictionary<UUID, sbyte>(); | 183 | Dictionary<UUID, sbyte> assetUuids = new Dictionary<UUID, sbyte>(); |
184 | HashSet<UUID> failedIDs = new HashSet<UUID>(); | 184 | HashSet<UUID> failedIDs = new HashSet<UUID>(); |
185 | HashSet<UUID> uncertainAssetsUUIDs = new HashSet<UUID>(); | ||
185 | 186 | ||
186 | scenesGroup.ForEachScene(delegate(Scene scene) | 187 | scenesGroup.ForEachScene(delegate(Scene scene) |
187 | { | 188 | { |
188 | string regionDir = MultiRegionFormat ? scenesGroup.GetRegionDir(scene.RegionInfo.RegionID) : ""; | 189 | string regionDir = MultiRegionFormat ? scenesGroup.GetRegionDir(scene.RegionInfo.RegionID) : ""; |
189 | ArchiveOneRegion(scene, regionDir, assetUuids, failedIDs); | 190 | ArchiveOneRegion(scene, regionDir, assetUuids, failedIDs, uncertainAssetsUUIDs); |
190 | }); | 191 | }); |
191 | 192 | ||
192 | // Archive the assets | 193 | // Archive the assets |
@@ -217,7 +218,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
217 | } | 218 | } |
218 | } | 219 | } |
219 | 220 | ||
220 | private void ArchiveOneRegion(Scene scene, string regionDir, Dictionary<UUID, sbyte> assetUuids, HashSet<UUID> failedIDs) | 221 | private void ArchiveOneRegion(Scene scene, string regionDir, Dictionary<UUID, sbyte> assetUuids, |
222 | HashSet<UUID> failedIDs, HashSet<UUID> uncertainAssetsUUIDs) | ||
221 | { | 223 | { |
222 | m_log.InfoFormat("[ARCHIVER]: Writing region {0}", scene.Name); | 224 | m_log.InfoFormat("[ARCHIVER]: Writing region {0}", scene.Name); |
223 | 225 | ||
@@ -253,24 +255,28 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
253 | 255 | ||
254 | if (SaveAssets) | 256 | if (SaveAssets) |
255 | { | 257 | { |
256 | UuidGatherer assetGatherer = new UuidGatherer(scene.AssetService, assetUuids, failedIDs); | 258 | UuidGatherer assetGatherer = new UuidGatherer(scene.AssetService, assetUuids, failedIDs, uncertainAssetsUUIDs); |
257 | int prevAssets = assetUuids.Count; | 259 | int prevAssets = assetUuids.Count; |
258 | 260 | ||
259 | foreach (SceneObjectGroup sceneObject in sceneObjects) | 261 | foreach (SceneObjectGroup sceneObject in sceneObjects) |
260 | { | 262 | { |
261 | int curErrorCntr = assetGatherer.ErrorCount; | 263 | int curErrorCntr = assetGatherer.ErrorCount; |
264 | int possible = assetGatherer.possibleNotAssetCount; | ||
262 | assetGatherer.AddForInspection(sceneObject); | 265 | assetGatherer.AddForInspection(sceneObject); |
263 | assetGatherer.GatherAll(); | 266 | assetGatherer.GatherAll(); |
264 | curErrorCntr = assetGatherer.ErrorCount - curErrorCntr; | 267 | curErrorCntr = assetGatherer.ErrorCount - curErrorCntr; |
265 | if(curErrorCntr > 1) | 268 | possible = assetGatherer.possibleNotAssetCount - possible; |
269 | if(curErrorCntr > 0) | ||
266 | { | 270 | { |
267 | m_log.WarnFormat("[ARCHIVER Warning]: object {0} '{1}', at {2}, contains {3} references to possible missing or damaged assets", | 271 | m_log.ErrorFormat("[ARCHIVER]: object {0} '{1}', at {2}, contains {3} references to missing or damaged assets", |
268 | sceneObject.UUID, sceneObject.Name ,sceneObject.AbsolutePosition.ToString(), curErrorCntr); | 272 | sceneObject.UUID, sceneObject.Name ,sceneObject.AbsolutePosition.ToString(), curErrorCntr); |
273 | if(possible > 0) | ||
274 | m_log.WarnFormat("[ARCHIVER Warning]: object also contains {0} references that may be to missing or damaged assets or not a problem", possible); | ||
269 | } | 275 | } |
270 | else if(curErrorCntr == 1) | 276 | else if(possible > 0) |
271 | { | 277 | { |
272 | m_log.WarnFormat("[ARCHIVER Warning]: object {0} '{1}', at {2}, contains a reference to a possible missing or damaged assets", | 278 | m_log.WarnFormat("[ARCHIVER Warning]: object {0} '{1}', at {2}, contains {3} references that may be to missing or damaged assets or not a problem", |
273 | sceneObject.UUID, sceneObject.Name, sceneObject.AbsolutePosition.ToString()); | 279 | sceneObject.UUID, sceneObject.Name ,sceneObject.AbsolutePosition.ToString(), possible); |
274 | } | 280 | } |
275 | } | 281 | } |
276 | 282 | ||
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 8ee7dbc..80d3f62 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs | |||
@@ -66,6 +66,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
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 | public HashSet<UUID> FailedUUIDs { get; private set; } |
69 | public HashSet<UUID> UncertainAssetsUUIDs { get; private set; } | ||
70 | public int possibleNotAssetCount { get; set; } | ||
69 | public int ErrorCount { get; private set; } | 71 | public int ErrorCount { get; private set; } |
70 | /// <summary> | 72 | /// <summary> |
71 | /// Gets the next UUID to inspect. | 73 | /// Gets the next UUID to inspect. |
@@ -93,8 +95,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
93 | /// <param name="assetService"> | 95 | /// <param name="assetService"> |
94 | /// Asset service. | 96 | /// Asset service. |
95 | /// </param> | 97 | /// </param> |
96 | public UuidGatherer(IAssetService assetService) : this(assetService, new Dictionary<UUID, sbyte>(), new HashSet <UUID>()) {} | 98 | public UuidGatherer(IAssetService assetService) : this(assetService, new Dictionary<UUID, sbyte>(), |
97 | public UuidGatherer(IAssetService assetService, IDictionary<UUID, sbyte> collector) : this(assetService, collector, new HashSet <UUID>()) {} | 99 | new HashSet <UUID>(),new HashSet <UUID>()) {} |
100 | public UuidGatherer(IAssetService assetService, IDictionary<UUID, sbyte> collector) : this(assetService, collector, | ||
101 | new HashSet <UUID>(), new HashSet <UUID>()) {} | ||
98 | 102 | ||
99 | /// <summary> | 103 | /// <summary> |
100 | /// Initializes a new instance of the <see cref="OpenSim.Region.Framework.Scenes.UuidGatherer"/> class. | 104 | /// Initializes a new instance of the <see cref="OpenSim.Region.Framework.Scenes.UuidGatherer"/> class. |
@@ -106,7 +110,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
106 | /// Gathered UUIDs will be collected in this dictionary. | 110 | /// Gathered UUIDs will be collected in this dictionary. |
107 | /// It can be pre-populated if you want to stop the gatherer from analyzing assets that have already been fetched and inspected. | 111 | /// It can be pre-populated if you want to stop the gatherer from analyzing assets that have already been fetched and inspected. |
108 | /// </param> | 112 | /// </param> |
109 | public UuidGatherer(IAssetService assetService, IDictionary<UUID, sbyte> collector, HashSet <UUID> failedIDs) | 113 | public UuidGatherer(IAssetService assetService, IDictionary<UUID, sbyte> collector, HashSet <UUID> failedIDs, HashSet <UUID> uncertainAssetsUUIDs) |
110 | { | 114 | { |
111 | m_assetService = assetService; | 115 | m_assetService = assetService; |
112 | GatheredUuids = collector; | 116 | GatheredUuids = collector; |
@@ -114,7 +118,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
114 | // FIXME: Not efficient for searching, can improve. | 118 | // FIXME: Not efficient for searching, can improve. |
115 | m_assetUuidsToInspect = new Queue<UUID>(); | 119 | m_assetUuidsToInspect = new Queue<UUID>(); |
116 | FailedUUIDs = failedIDs; | 120 | FailedUUIDs = failedIDs; |
121 | UncertainAssetsUUIDs = uncertainAssetsUUIDs; | ||
117 | ErrorCount = 0; | 122 | ErrorCount = 0; |
123 | possibleNotAssetCount = 0; | ||
118 | } | 124 | } |
119 | 125 | ||
120 | /// <summary> | 126 | /// <summary> |
@@ -124,8 +130,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
124 | /// <param name="uuid">UUID.</param> | 130 | /// <param name="uuid">UUID.</param> |
125 | public bool AddForInspection(UUID uuid) | 131 | public bool AddForInspection(UUID uuid) |
126 | { | 132 | { |
133 | if(uuid == UUID.Zero) | ||
134 | return false; | ||
135 | |||
127 | if(FailedUUIDs.Contains(uuid)) | 136 | if(FailedUUIDs.Contains(uuid)) |
128 | return false; | 137 | { |
138 | if(UncertainAssetsUUIDs.Contains(uuid)) | ||
139 | possibleNotAssetCount++; | ||
140 | else | ||
141 | ErrorCount++; | ||
142 | return false; | ||
143 | } | ||
129 | if(GatheredUuids.ContainsKey(uuid)) | 144 | if(GatheredUuids.ContainsKey(uuid)) |
130 | return false; | 145 | return false; |
131 | if (m_assetUuidsToInspect.Contains(uuid)) | 146 | if (m_assetUuidsToInspect.Contains(uuid)) |
@@ -283,9 +298,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
283 | /// <param name="assetUuid">The uuid of the asset for which to gather referenced assets</param> | 298 | /// <param name="assetUuid">The uuid of the asset for which to gather referenced assets</param> |
284 | private void GetAssetUuids(UUID assetUuid) | 299 | private void GetAssetUuids(UUID assetUuid) |
285 | { | 300 | { |
301 | if(assetUuid == UUID.Zero) | ||
302 | return; | ||
303 | |||
286 | if(FailedUUIDs.Contains(assetUuid)) | 304 | if(FailedUUIDs.Contains(assetUuid)) |
287 | { | 305 | { |
288 | ErrorCount++; | 306 | if(UncertainAssetsUUIDs.Contains(assetUuid)) |
307 | possibleNotAssetCount++; | ||
308 | else | ||
309 | ErrorCount++; | ||
289 | return; | 310 | return; |
290 | } | 311 | } |
291 | 312 | ||
@@ -309,11 +330,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
309 | if(assetBase == null) | 330 | if(assetBase == null) |
310 | { | 331 | { |
311 | // m_log.ErrorFormat("[UUID GATHERER]: asset {0} not found", assetUuid); | 332 | // m_log.ErrorFormat("[UUID GATHERER]: asset {0} not found", assetUuid); |
312 | ErrorCount++; | ||
313 | FailedUUIDs.Add(assetUuid); | 333 | FailedUUIDs.Add(assetUuid); |
334 | if(UncertainAssetsUUIDs.Contains(assetUuid)) | ||
335 | possibleNotAssetCount++; | ||
336 | else | ||
337 | ErrorCount++; | ||
314 | return; | 338 | return; |
315 | } | 339 | } |
316 | 340 | ||
341 | if(UncertainAssetsUUIDs.Contains(assetUuid)) | ||
342 | UncertainAssetsUUIDs.Remove(assetUuid); | ||
343 | |||
317 | sbyte assetType = assetBase.Type; | 344 | sbyte assetType = assetBase.Type; |
318 | 345 | ||
319 | if(assetBase.Data == null || assetBase.Data.Length == 0) | 346 | if(assetBase.Data == null || assetBase.Data.Length == 0) |
@@ -363,10 +390,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
363 | 390 | ||
364 | private void AddForInspection(UUID assetUuid, sbyte assetType) | 391 | private void AddForInspection(UUID assetUuid, sbyte assetType) |
365 | { | 392 | { |
393 | if(assetUuid == UUID.Zero) | ||
394 | return; | ||
395 | |||
366 | // Here, we want to collect uuids which require further asset fetches but mark the others as gathered | 396 | // Here, we want to collect uuids which require further asset fetches but mark the others as gathered |
367 | if(FailedUUIDs.Contains(assetUuid)) | 397 | if(FailedUUIDs.Contains(assetUuid)) |
368 | { | 398 | { |
369 | ErrorCount++; | 399 | if(UncertainAssetsUUIDs.Contains(assetUuid)) |
400 | possibleNotAssetCount++; | ||
401 | else | ||
402 | ErrorCount++; | ||
370 | return; | 403 | return; |
371 | } | 404 | } |
372 | if(GatheredUuids.ContainsKey(assetUuid)) | 405 | if(GatheredUuids.ContainsKey(assetUuid)) |
@@ -502,8 +535,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
502 | foreach (Match uuidMatch in uuidMatches) | 535 | foreach (Match uuidMatch in uuidMatches) |
503 | { | 536 | { |
504 | UUID uuid = new UUID(uuidMatch.Value); | 537 | UUID uuid = new UUID(uuidMatch.Value); |
538 | if(uuid == UUID.Zero) | ||
539 | continue; | ||
505 | // m_log.DebugFormat("[UUID GATHERER]: Recording {0} in text", uuid); | 540 | // m_log.DebugFormat("[UUID GATHERER]: Recording {0} in text", uuid); |
506 | 541 | if(!UncertainAssetsUUIDs.Contains(uuid)) | |
542 | UncertainAssetsUUIDs.Add(uuid); | ||
507 | AddForInspection(uuid); | 543 | AddForInspection(uuid); |
508 | } | 544 | } |
509 | } | 545 | } |