From 16937996231aef5efa4c12fa51b84bc8273c76f7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 10 Mar 2012 02:03:07 +0000 Subject: On OAR saving, try fetch assets serially rather than firing all the requests at the asset service at once. This may (or may not) improve reliability for http://opensimulator.org/mantis/view.php?id=5898 Quick tests show that save time is the same. --- .../World/Archiver/ArchiveWriteRequestPreparation.cs | 17 ++++++++++++----- .../Region/CoreModules/World/Archiver/AssetsRequest.cs | 10 ++++++---- 2 files changed, 18 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/CoreModules/World/Archiver') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index ffcf063..aef3ad3 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs @@ -219,12 +219,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); if (SaveAssets) - new AssetsRequest( - new AssetsArchiver(archiveWriter), assetUuids, - m_scene.AssetService, m_scene.UserAccountService, - m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets).Execute(); + { + AssetsRequest ar + = new AssetsRequest( + new AssetsArchiver(archiveWriter), assetUuids, + m_scene.AssetService, m_scene.UserAccountService, + m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets); + + Util.FireAndForget(o => ar.Execute()); + } else - awre.ReceivedAllAssets(new List(), new List()); + { + Util.FireAndForget(o => awre.ReceivedAllAssets(new List(), new List())); + } } catch (Exception) { diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 8e29e3c..55110dc 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs @@ -141,13 +141,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver PerformAssetsRequestCallback(null); return; } - + + m_requestCallbackTimer.Enabled = true; + foreach (KeyValuePair kvp in m_uuids) { - m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); +// m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); + AssetBase asset = m_assetService.Get(kvp.Key.ToString()); + PreAssetRequestCallback(kvp.Key.ToString(), kvp.Value, asset); } - - m_requestCallbackTimer.Enabled = true; } protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) -- cgit v1.1 From 5507752dc576f9224c6ee71be003fc055b32579d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 10 Mar 2012 02:11:30 +0000 Subject: minor: rearrange some save oar messages so they say what they're about to do rather than what they've just done. --- .../World/Archiver/ArchiveWriteRequestExecution.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/CoreModules/World/Archiver') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs index 9ec4ebe..c179a34 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs @@ -108,12 +108,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver // "[ARCHIVER]: Received {0} of {1} assets requested", // assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count); + m_log.InfoFormat("[ARCHIVER]: Adding region settings to archive."); + // Write out region settings string settingsPath = String.Format("{0}{1}.xml", ArchiveConstants.SETTINGS_PATH, m_scene.RegionInfo.RegionName); m_archiveWriter.WriteFile(settingsPath, RegionSettingsSerializer.Serialize(m_scene.RegionInfo.RegionSettings)); - m_log.InfoFormat("[ARCHIVER]: Added region settings to archive."); + m_log.InfoFormat("[ARCHIVER]: Adding parcel settings to archive."); // Write out land data (aka parcel) settings ListlandObjects = m_scene.LandChannel.AllParcels(); @@ -124,7 +126,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver landData.GlobalID.ToString()); m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData)); } - m_log.InfoFormat("[ARCHIVER]: Added parcel settings to archive."); + + m_log.InfoFormat("[ARCHIVER]: Adding terrain information to archive."); // Write out terrain string terrainPath @@ -135,7 +138,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_archiveWriter.WriteFile(terrainPath, ms.ToArray()); ms.Close(); - m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive."); + m_log.InfoFormat("[ARCHIVER]: Adding scene objects to archive."); // Write out scene object metadata foreach (SceneObjectGroup sceneObject in m_sceneObjects) @@ -145,10 +148,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options); m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject); } - - m_log.InfoFormat("[ARCHIVER]: Added scene objects to archive."); } - - } -} +} \ No newline at end of file -- cgit v1.1 From 05e821c4442d4d3825367ba8f8c544d250cffd2d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 10 Mar 2012 03:11:28 +0000 Subject: Fix TestSaveOarNoAssets() by not launch a no-assets request on a separate thread. This was previous behaviour anyway. --- .../Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules/World/Archiver') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index aef3ad3..4d459bf 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs @@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver } else { - Util.FireAndForget(o => awre.ReceivedAllAssets(new List(), new List())); + awre.ReceivedAllAssets(new List(), new List()); } } catch (Exception) -- cgit v1.1