a few more changes to iar/oar assets save error/warning to show problems known to be asset errors
parent
0a1f497dee
commit
191661b51d
|
@ -223,10 +223,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
if (SaveAssets && itemAssetType != AssetType.Link && itemAssetType != AssetType.LinkFolder)
|
if (SaveAssets && itemAssetType != AssetType.Link && itemAssetType != AssetType.LinkFolder)
|
||||||
{
|
{
|
||||||
int curErrorCntr = m_assetGatherer.ErrorCount;
|
int curErrorCntr = m_assetGatherer.ErrorCount;
|
||||||
|
int possible = m_assetGatherer.possibleNotAssetCount;
|
||||||
m_assetGatherer.AddForInspection(inventoryItem.AssetID);
|
m_assetGatherer.AddForInspection(inventoryItem.AssetID);
|
||||||
m_assetGatherer.GatherAll();
|
m_assetGatherer.GatherAll();
|
||||||
curErrorCntr = m_assetGatherer.ErrorCount - curErrorCntr;
|
curErrorCntr = m_assetGatherer.ErrorCount - curErrorCntr;
|
||||||
if(curErrorCntr > 0)
|
possible = m_assetGatherer.possibleNotAssetCount - possible;
|
||||||
|
|
||||||
|
if(curErrorCntr > 0 || possible > 0)
|
||||||
{
|
{
|
||||||
string spath;
|
string spath;
|
||||||
int indx = path.IndexOf("__");
|
int indx = path.IndexOf("__");
|
||||||
|
@ -235,15 +238,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
else
|
else
|
||||||
spath = path;
|
spath = path;
|
||||||
|
|
||||||
if(curErrorCntr > 1)
|
if(curErrorCntr > 0)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[INVENTORY ARCHIVER Warning]: item {0} '{1}', type {2}, in '{3}', contains {4} references to possible missing or damaged assets )",
|
m_log.ErrorFormat("[INVENTORY ARCHIVER Warning]: item {0} '{1}', type {2}, in '{3}', contains {4} references to missing or damaged assets",
|
||||||
inventoryItem.ID, inventoryItem.Name, itemAssetType.ToString(), spath, curErrorCntr);
|
inventoryItem.ID, inventoryItem.Name, itemAssetType.ToString(), spath, curErrorCntr);
|
||||||
|
if(possible > 0)
|
||||||
|
m_log.WarnFormat("[INVENTORY ARCHIVER Warning]: item also contains {0} references that may be to missing or damaged assets or not a problem", possible);
|
||||||
}
|
}
|
||||||
else if(curErrorCntr == 1)
|
else if(possible > 0)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[INVENTORY ARCHIVER Warning]: item {0} '{1}', type {2}, in '{3}', contains a reference to a possible missing or damaged asset)",
|
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);
|
||||||
inventoryItem.ID, inventoryItem.Name, itemAssetType.ToString(), spath);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,11 +182,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
|
|
||||||
Dictionary<UUID, sbyte> assetUuids = new Dictionary<UUID, sbyte>();
|
Dictionary<UUID, sbyte> assetUuids = new Dictionary<UUID, sbyte>();
|
||||||
HashSet<UUID> failedIDs = new HashSet<UUID>();
|
HashSet<UUID> failedIDs = new HashSet<UUID>();
|
||||||
|
HashSet<UUID> uncertainAssetsUUIDs = new HashSet<UUID>();
|
||||||
|
|
||||||
scenesGroup.ForEachScene(delegate(Scene scene)
|
scenesGroup.ForEachScene(delegate(Scene scene)
|
||||||
{
|
{
|
||||||
string regionDir = MultiRegionFormat ? scenesGroup.GetRegionDir(scene.RegionInfo.RegionID) : "";
|
string regionDir = MultiRegionFormat ? scenesGroup.GetRegionDir(scene.RegionInfo.RegionID) : "";
|
||||||
ArchiveOneRegion(scene, regionDir, assetUuids, failedIDs);
|
ArchiveOneRegion(scene, regionDir, assetUuids, failedIDs, uncertainAssetsUUIDs);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Archive the assets
|
// Archive the assets
|
||||||
|
@ -217,7 +218,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ArchiveOneRegion(Scene scene, string regionDir, Dictionary<UUID, sbyte> assetUuids, HashSet<UUID> failedIDs)
|
private void ArchiveOneRegion(Scene scene, string regionDir, Dictionary<UUID, sbyte> assetUuids,
|
||||||
|
HashSet<UUID> failedIDs, HashSet<UUID> uncertainAssetsUUIDs)
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[ARCHIVER]: Writing region {0}", scene.Name);
|
m_log.InfoFormat("[ARCHIVER]: Writing region {0}", scene.Name);
|
||||||
|
|
||||||
|
@ -253,24 +255,28 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
|
|
||||||
if (SaveAssets)
|
if (SaveAssets)
|
||||||
{
|
{
|
||||||
UuidGatherer assetGatherer = new UuidGatherer(scene.AssetService, assetUuids, failedIDs);
|
UuidGatherer assetGatherer = new UuidGatherer(scene.AssetService, assetUuids, failedIDs, uncertainAssetsUUIDs);
|
||||||
int prevAssets = assetUuids.Count;
|
int prevAssets = assetUuids.Count;
|
||||||
|
|
||||||
foreach (SceneObjectGroup sceneObject in sceneObjects)
|
foreach (SceneObjectGroup sceneObject in sceneObjects)
|
||||||
{
|
{
|
||||||
int curErrorCntr = assetGatherer.ErrorCount;
|
int curErrorCntr = assetGatherer.ErrorCount;
|
||||||
|
int possible = assetGatherer.possibleNotAssetCount;
|
||||||
assetGatherer.AddForInspection(sceneObject);
|
assetGatherer.AddForInspection(sceneObject);
|
||||||
assetGatherer.GatherAll();
|
assetGatherer.GatherAll();
|
||||||
curErrorCntr = assetGatherer.ErrorCount - curErrorCntr;
|
curErrorCntr = assetGatherer.ErrorCount - curErrorCntr;
|
||||||
if(curErrorCntr > 1)
|
possible = assetGatherer.possibleNotAssetCount - possible;
|
||||||
|
if(curErrorCntr > 0)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[ARCHIVER Warning]: object {0} '{1}', at {2}, contains {3} references to possible missing or damaged assets",
|
m_log.ErrorFormat("[ARCHIVER]: object {0} '{1}', at {2}, contains {3} references to missing or damaged assets",
|
||||||
sceneObject.UUID, sceneObject.Name ,sceneObject.AbsolutePosition.ToString(), curErrorCntr);
|
sceneObject.UUID, sceneObject.Name ,sceneObject.AbsolutePosition.ToString(), curErrorCntr);
|
||||||
|
if(possible > 0)
|
||||||
|
m_log.WarnFormat("[ARCHIVER Warning]: object also contains {0} references that may be to missing or damaged assets or not a problem", possible);
|
||||||
}
|
}
|
||||||
else if(curErrorCntr == 1)
|
else if(possible > 0)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[ARCHIVER Warning]: object {0} '{1}', at {2}, contains a reference to a possible missing or damaged assets",
|
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",
|
||||||
sceneObject.UUID, sceneObject.Name, sceneObject.AbsolutePosition.ToString());
|
sceneObject.UUID, sceneObject.Name ,sceneObject.AbsolutePosition.ToString(), possible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <value>The gathered uuids.</value>
|
/// <value>The gathered uuids.</value>
|
||||||
public IDictionary<UUID, sbyte> GatheredUuids { get; private set; }
|
public IDictionary<UUID, sbyte> GatheredUuids { get; private set; }
|
||||||
public HashSet<UUID> FailedUUIDs { get; private set; }
|
public HashSet<UUID> FailedUUIDs { get; private set; }
|
||||||
|
public HashSet<UUID> UncertainAssetsUUIDs { get; private set; }
|
||||||
|
public int possibleNotAssetCount { get; set; }
|
||||||
public int ErrorCount { get; private set; }
|
public int ErrorCount { get; private set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the next UUID to inspect.
|
/// Gets the next UUID to inspect.
|
||||||
|
@ -93,8 +95,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="assetService">
|
/// <param name="assetService">
|
||||||
/// Asset service.
|
/// Asset service.
|
||||||
/// </param>
|
/// </param>
|
||||||
public UuidGatherer(IAssetService assetService) : this(assetService, new Dictionary<UUID, sbyte>(), new HashSet <UUID>()) {}
|
public UuidGatherer(IAssetService assetService) : this(assetService, new Dictionary<UUID, sbyte>(),
|
||||||
public UuidGatherer(IAssetService assetService, IDictionary<UUID, sbyte> collector) : this(assetService, collector, new HashSet <UUID>()) {}
|
new HashSet <UUID>(),new HashSet <UUID>()) {}
|
||||||
|
public UuidGatherer(IAssetService assetService, IDictionary<UUID, sbyte> collector) : this(assetService, collector,
|
||||||
|
new HashSet <UUID>(), new HashSet <UUID>()) {}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="OpenSim.Region.Framework.Scenes.UuidGatherer"/> class.
|
/// Initializes a new instance of the <see cref="OpenSim.Region.Framework.Scenes.UuidGatherer"/> class.
|
||||||
|
@ -106,7 +110,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// Gathered UUIDs will be collected in this dictionary.
|
/// Gathered UUIDs will be collected in this dictionary.
|
||||||
/// It can be pre-populated if you want to stop the gatherer from analyzing assets that have already been fetched and inspected.
|
/// It can be pre-populated if you want to stop the gatherer from analyzing assets that have already been fetched and inspected.
|
||||||
/// </param>
|
/// </param>
|
||||||
public UuidGatherer(IAssetService assetService, IDictionary<UUID, sbyte> collector, HashSet <UUID> failedIDs)
|
public UuidGatherer(IAssetService assetService, IDictionary<UUID, sbyte> collector, HashSet <UUID> failedIDs, HashSet <UUID> uncertainAssetsUUIDs)
|
||||||
{
|
{
|
||||||
m_assetService = assetService;
|
m_assetService = assetService;
|
||||||
GatheredUuids = collector;
|
GatheredUuids = collector;
|
||||||
|
@ -114,7 +118,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// FIXME: Not efficient for searching, can improve.
|
// FIXME: Not efficient for searching, can improve.
|
||||||
m_assetUuidsToInspect = new Queue<UUID>();
|
m_assetUuidsToInspect = new Queue<UUID>();
|
||||||
FailedUUIDs = failedIDs;
|
FailedUUIDs = failedIDs;
|
||||||
|
UncertainAssetsUUIDs = uncertainAssetsUUIDs;
|
||||||
ErrorCount = 0;
|
ErrorCount = 0;
|
||||||
|
possibleNotAssetCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -124,8 +130,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="uuid">UUID.</param>
|
/// <param name="uuid">UUID.</param>
|
||||||
public bool AddForInspection(UUID uuid)
|
public bool AddForInspection(UUID uuid)
|
||||||
{
|
{
|
||||||
|
if(uuid == UUID.Zero)
|
||||||
|
return false;
|
||||||
|
|
||||||
if(FailedUUIDs.Contains(uuid))
|
if(FailedUUIDs.Contains(uuid))
|
||||||
return false;
|
{
|
||||||
|
if(UncertainAssetsUUIDs.Contains(uuid))
|
||||||
|
possibleNotAssetCount++;
|
||||||
|
else
|
||||||
|
ErrorCount++;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if(GatheredUuids.ContainsKey(uuid))
|
if(GatheredUuids.ContainsKey(uuid))
|
||||||
return false;
|
return false;
|
||||||
if (m_assetUuidsToInspect.Contains(uuid))
|
if (m_assetUuidsToInspect.Contains(uuid))
|
||||||
|
@ -283,9 +298,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="assetUuid">The uuid of the asset for which to gather referenced assets</param>
|
/// <param name="assetUuid">The uuid of the asset for which to gather referenced assets</param>
|
||||||
private void GetAssetUuids(UUID assetUuid)
|
private void GetAssetUuids(UUID assetUuid)
|
||||||
{
|
{
|
||||||
|
if(assetUuid == UUID.Zero)
|
||||||
|
return;
|
||||||
|
|
||||||
if(FailedUUIDs.Contains(assetUuid))
|
if(FailedUUIDs.Contains(assetUuid))
|
||||||
{
|
{
|
||||||
ErrorCount++;
|
if(UncertainAssetsUUIDs.Contains(assetUuid))
|
||||||
|
possibleNotAssetCount++;
|
||||||
|
else
|
||||||
|
ErrorCount++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,11 +330,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if(assetBase == null)
|
if(assetBase == null)
|
||||||
{
|
{
|
||||||
// m_log.ErrorFormat("[UUID GATHERER]: asset {0} not found", assetUuid);
|
// m_log.ErrorFormat("[UUID GATHERER]: asset {0} not found", assetUuid);
|
||||||
ErrorCount++;
|
|
||||||
FailedUUIDs.Add(assetUuid);
|
FailedUUIDs.Add(assetUuid);
|
||||||
|
if(UncertainAssetsUUIDs.Contains(assetUuid))
|
||||||
|
possibleNotAssetCount++;
|
||||||
|
else
|
||||||
|
ErrorCount++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(UncertainAssetsUUIDs.Contains(assetUuid))
|
||||||
|
UncertainAssetsUUIDs.Remove(assetUuid);
|
||||||
|
|
||||||
sbyte assetType = assetBase.Type;
|
sbyte assetType = assetBase.Type;
|
||||||
|
|
||||||
if(assetBase.Data == null || assetBase.Data.Length == 0)
|
if(assetBase.Data == null || assetBase.Data.Length == 0)
|
||||||
|
@ -363,10 +390,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
private void AddForInspection(UUID assetUuid, sbyte assetType)
|
private void AddForInspection(UUID assetUuid, sbyte assetType)
|
||||||
{
|
{
|
||||||
|
if(assetUuid == UUID.Zero)
|
||||||
|
return;
|
||||||
|
|
||||||
// Here, we want to collect uuids which require further asset fetches but mark the others as gathered
|
// Here, we want to collect uuids which require further asset fetches but mark the others as gathered
|
||||||
if(FailedUUIDs.Contains(assetUuid))
|
if(FailedUUIDs.Contains(assetUuid))
|
||||||
{
|
{
|
||||||
ErrorCount++;
|
if(UncertainAssetsUUIDs.Contains(assetUuid))
|
||||||
|
possibleNotAssetCount++;
|
||||||
|
else
|
||||||
|
ErrorCount++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(GatheredUuids.ContainsKey(assetUuid))
|
if(GatheredUuids.ContainsKey(assetUuid))
|
||||||
|
@ -502,8 +535,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
foreach (Match uuidMatch in uuidMatches)
|
foreach (Match uuidMatch in uuidMatches)
|
||||||
{
|
{
|
||||||
UUID uuid = new UUID(uuidMatch.Value);
|
UUID uuid = new UUID(uuidMatch.Value);
|
||||||
|
if(uuid == UUID.Zero)
|
||||||
|
continue;
|
||||||
// m_log.DebugFormat("[UUID GATHERER]: Recording {0} in text", uuid);
|
// m_log.DebugFormat("[UUID GATHERER]: Recording {0} in text", uuid);
|
||||||
|
if(!UncertainAssetsUUIDs.Contains(uuid))
|
||||||
|
UncertainAssetsUUIDs.Add(uuid);
|
||||||
AddForInspection(uuid);
|
AddForInspection(uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue