diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index c218f5d414..144cbbee6f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -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(); diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs index 761fecee4f..9500eb657a 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs @@ -181,11 +181,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver // Archive the regions Dictionary assetUuids = new Dictionary(); + HashSet failedIDs = new HashSet(); 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 assetUuids) + private void ArchiveOneRegion(Scene scene, string regionDir, Dictionary assetUuids, HashSet 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) diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs index efacae372f..3092fe0a8d 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs @@ -46,7 +46,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// /// Post a message to the log every x assets as a progress bar /// - protected static int LOG_ASSET_LOAD_NOTIFICATION_INTERVAL = 50; + protected static int LOG_ASSET_LOAD_NOTIFICATION_INTERVAL = 100; /// /// Keep a count of the number of assets written so that we can provide status updates diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index f3034981d6..903cb2dd31 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs @@ -65,6 +65,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// uuids to request /// protected IDictionary m_uuids; + private int m_previusErrorsCount; /// /// 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 uuids, + int previusErrorsCount, IAssetService assetService, IUserAccountService userService, UUID scope, Dictionary 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 /// /// Perform the callback on the original requester of the assets /// - 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")) { diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 3a71c12e6f..548aa3a43d 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -93,7 +93,8 @@ namespace OpenSim.Region.Framework.Scenes /// /// Asset service. /// - public UuidGatherer(IAssetService assetService) : this(assetService, new Dictionary()) {} + public UuidGatherer(IAssetService assetService) : this(assetService, new Dictionary(), new HashSet ()) {} + public UuidGatherer(IAssetService assetService, IDictionary collector) : this(assetService, collector, new HashSet ()) {} /// /// Initializes a new instance of the 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. /// - public UuidGatherer(IAssetService assetService, IDictionary collector) + public UuidGatherer(IAssetService assetService, IDictionary collector, HashSet failedIDs) { m_assetService = assetService; GatheredUuids = collector; // FIXME: Not efficient for searching, can improve. m_assetUuidsToInspect = new Queue(); - FailedUUIDs = new HashSet(); + FailedUUIDs = failedIDs; } /// @@ -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; }