several changes to iar/oar assets error reports

0.9.0-post-fixes
UbitUmarov 2017-06-23 15:50:16 +01:00
parent 28caf1e089
commit 3c6790b061
5 changed files with 33 additions and 26 deletions

View File

@ -422,15 +422,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
m_assetGatherer.GatherAll();
m_log.DebugFormat(
"[INVENTORY ARCHIVER]: Saving {0} assets for items", m_assetGatherer.GatheredUuids.Count);
int errors = m_assetGatherer.FailedUUIDs.Count;
m_log.DebugFormat(
"[INVENTORY ARCHIVER]: The items to save reference {0} assets", m_assetGatherer.GatheredUuids.Count + errors);
if(errors > 0)
m_log.DebugFormat("[INVENTORY ARCHIVER]: aditional {0} assets have problems and will be ignored", errors);
m_log.DebugFormat("[INVENTORY ARCHIVER]: {0} of this assets have problems and will be ignored", errors);
AssetsRequest ar = new AssetsRequest(
new AssetsArchiver(m_archiveWriter),
m_assetGatherer.GatheredUuids, m_scene.AssetService,
m_assetGatherer.GatheredUuids, m_assetGatherer.FailedUUIDs.Count,
m_scene.AssetService,
m_scene.UserAccountService, m_scene.RegionInfo.ScopeID,
options, ReceivedAllAssets);
ar.Execute();

View File

@ -181,11 +181,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
// Archive the regions
Dictionary<UUID, sbyte> assetUuids = new Dictionary<UUID, sbyte>();
HashSet<UUID> failedIDs = new HashSet<UUID>();
scenesGroup.ForEachScene(delegate(Scene scene)
{
string regionDir = MultiRegionFormat ? scenesGroup.GetRegionDir(scene.RegionInfo.RegionID) : "";
ArchiveOneRegion(scene, regionDir, assetUuids);
ArchiveOneRegion(scene, regionDir, assetUuids, failedIDs);
});
// Archive the assets
@ -196,6 +197,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
AssetsRequest ar = new AssetsRequest(
new AssetsArchiver(m_archiveWriter), assetUuids,
failedIDs.Count,
m_rootScene.AssetService, m_rootScene.UserAccountService,
m_rootScene.RegionInfo.ScopeID, options, null);
ar.Execute();
@ -215,7 +217,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
}
}
private void ArchiveOneRegion(Scene scene, string regionDir, Dictionary<UUID, sbyte> assetUuids)
private void ArchiveOneRegion(Scene scene, string regionDir, Dictionary<UUID, sbyte> assetUuids, HashSet<UUID> failedIDs)
{
m_log.InfoFormat("[ARCHIVER]: Writing region {0}", scene.Name);
@ -251,7 +253,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
if (SaveAssets)
{
UuidGatherer assetGatherer = new UuidGatherer(scene.AssetService, assetUuids);
UuidGatherer assetGatherer = new UuidGatherer(scene.AssetService, assetUuids, failedIDs);
int prevAssets = assetUuids.Count;
foreach (SceneObjectGroup sceneObject in sceneObjects)
@ -259,12 +261,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
assetGatherer.GatherAll();
m_log.DebugFormat(
"[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets",
sceneObjects.Count, assetUuids.Count - prevAssets);
int errors = assetGatherer.FailedUUIDs.Count;
m_log.DebugFormat(
"[ARCHIVER]: {0} region scene objects to save reference {1} assets",
sceneObjects.Count, assetUuids.Count - prevAssets + errors);
if(errors > 0)
m_log.DebugFormat("[ARCHIVER]: aditional {0} assets have problems and will be ignored", errors);
m_log.DebugFormat("[ARCHIVER]: {0} of this assets have problems and will be ignored", errors);
}
if (numObjectsSkippedPermissions > 0)

View File

@ -46,7 +46,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// <value>
/// Post a message to the log every x assets as a progress bar
/// </value>
protected static int LOG_ASSET_LOAD_NOTIFICATION_INTERVAL = 50;
protected static int LOG_ASSET_LOAD_NOTIFICATION_INTERVAL = 100;
/// <value>
/// Keep a count of the number of assets written so that we can provide status updates

View File

@ -65,6 +65,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// uuids to request
/// </value>
protected IDictionary<UUID, sbyte> m_uuids;
private int m_previusErrorsCount;
/// <value>
/// Callback used when all the assets requested have been received.
@ -102,12 +103,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver
protected internal AssetsRequest(
AssetsArchiver assetsArchiver, IDictionary<UUID, sbyte> uuids,
int previusErrorsCount,
IAssetService assetService, IUserAccountService userService,
UUID scope, Dictionary<string, object> options,
AssetsRequestCallback assetsRequestCallback)
{
m_assetsArchiver = assetsArchiver;
m_uuids = uuids;
m_previusErrorsCount = previusErrorsCount;
m_assetsRequestCallback = assetsRequestCallback;
m_assetService = assetService;
m_userAccountService = userService;
@ -119,8 +122,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
protected internal void Execute()
{
Culture.SetCurrentCulture();
m_log.DebugFormat("[ARCHIVER]: AssetsRequest executed looking for {0} possible assets", m_repliesRequired);
// We can stop here if there are no assets to fetch
if (m_repliesRequired == 0)
{
@ -169,19 +170,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver
}
m_timeOutTimer.Dispose();
int totalerrors = m_notFoundAssetUuids.Count + m_previusErrorsCount;
if(m_timeout)
m_log.DebugFormat("[ARCHIVER]: Aborted because AssetService request timeout. Successfully added {0} assets", m_foundAssetUuids.Count);
else if(m_notFoundAssetUuids.Count == 0)
else if(totalerrors == 0)
m_log.DebugFormat("[ARCHIVER]: Successfully added all {0} assets", m_foundAssetUuids.Count);
else
m_log.DebugFormat("[ARCHIVER]: Successfully added {0} assets ({1} assets not found)",
m_foundAssetUuids.Count, m_notFoundAssetUuids.Count);
m_log.DebugFormat("[ARCHIVER]: Successfully added {0} assets ({1} assets of total request where not found or are damaged",
m_foundAssetUuids.Count, totalerrors);
PerformAssetsRequestCallback(m_timeout);
}
void OnTimeout(object source, ElapsedEventArgs args)
private void OnTimeout(object source, ElapsedEventArgs args)
{
m_timeout = true;
}
@ -189,7 +191,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// <summary>
/// Perform the callback on the original requester of the assets
/// </summary>
protected void PerformAssetsRequestCallback(object o)
private void PerformAssetsRequestCallback(object o)
{
if(m_assetsRequestCallback == null)
return;
@ -208,7 +210,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
}
}
protected AssetBase PostProcess(AssetBase asset)
private AssetBase PostProcess(AssetBase asset)
{
if (asset.Type == (sbyte)AssetType.Object && asset.Data != null && m_options.ContainsKey("home"))
{

View File

@ -93,7 +93,8 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="assetService">
/// Asset service.
/// </param>
public UuidGatherer(IAssetService assetService) : this(assetService, new Dictionary<UUID, sbyte>()) {}
public UuidGatherer(IAssetService assetService) : this(assetService, new Dictionary<UUID, sbyte>(), new HashSet <UUID>()) {}
public UuidGatherer(IAssetService assetService, IDictionary<UUID, sbyte> collector) : this(assetService, collector, new HashSet <UUID>()) {}
/// <summary>
/// Initializes a new instance of the <see cref="OpenSim.Region.Framework.Scenes.UuidGatherer"/> class.
@ -105,14 +106,14 @@ namespace OpenSim.Region.Framework.Scenes
/// Gathered UUIDs will be collected in this dictinaory.
/// It can be pre-populated if you want to stop the gatherer from analyzing assets that have already been fetched and inspected.
/// </param>
public UuidGatherer(IAssetService assetService, IDictionary<UUID, sbyte> collector)
public UuidGatherer(IAssetService assetService, IDictionary<UUID, sbyte> collector, HashSet <UUID> failedIDs)
{
m_assetService = assetService;
GatheredUuids = collector;
// FIXME: Not efficient for searching, can improve.
m_assetUuidsToInspect = new Queue<UUID>();
FailedUUIDs = new HashSet<UUID>();
FailedUUIDs = failedIDs;
}
/// <summary>
@ -301,14 +302,14 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (Exception e)
{
m_log.ErrorFormat("[UUID GATHERER]: Failed to get asset with id {0} : {1}", assetUuid, e.Message);
m_log.ErrorFormat("[UUID GATHERER]: Failed to get asset {0} : {1}", assetUuid, e.Message);
FailedUUIDs.Add(assetUuid);
return;
}
if(assetBase == null)
{
m_log.ErrorFormat("[UUID GATHERER]: asset with id {0} not found", assetUuid);
m_log.ErrorFormat("[UUID GATHERER]: asset {0} not found", assetUuid);
FailedUUIDs.Add(assetUuid);
return;
}
@ -317,7 +318,7 @@ namespace OpenSim.Region.Framework.Scenes
if(assetBase.Data == null || assetBase.Data.Length == 0)
{
m_log.ErrorFormat("[UUID GATHERER]: asset with id {0} type {1} has no data", assetUuid, assetType);
m_log.ErrorFormat("[UUID GATHERER]: asset {0}, type {1} has no data", assetUuid, assetType);
FailedUUIDs.Add(assetUuid);
return;
}