From ec4189b722b86a3acca0d54a19fff7cc13c1aff2 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 16 Sep 2008 17:30:30 +0000 Subject: * If an individual scene object throws an exception while storing, deal with this locally rather than letting it propogate up the stack * This will allow other scene objects to persist and stop the exception taking down the whole region server --- OpenSim/Region/Environment/Scenes/Scene.cs | 1 - .../Region/Environment/Scenes/SceneObjectGroup.cs | 55 +++++++++++++--------- 2 files changed, 33 insertions(+), 23 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 2a736fb..78c8c62 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -885,7 +885,6 @@ namespace OpenSim.Region.Environment.Scenes { EventManager.TriggerOnBackup(m_storageManager.DataStore); m_backingup = false; - //return true; } #endregion diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 84970c2..628db0c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -1124,39 +1124,50 @@ namespace OpenSim.Region.Environment.Scenes #region Events /// - /// Processes backup + /// Processes backup. /// /// public void ProcessBackup(IRegionDataStore datastore) { - if (HasGroupChanged) + // Since this is the top of the section of call stack for backing up a particular scene object, don't let + // any exception propogate upwards. + try { - // don't backup while it's selected or you're asking for changes mid stream. - if ((!IsSelected) && (RootPart != null)) + if (HasGroupChanged) { - m_log.InfoFormat( - "[SCENE]: Storing object {0}, {1} in {2}", - Name, UUID, m_scene.RegionInfo.RegionName); + // don't backup while it's selected or you're asking for changes mid stream. + if ((!IsSelected) && (RootPart != null)) + { + m_log.InfoFormat( + "[SCENE]: Storing {0}, {1} in {2}", + Name, UUID, m_scene.RegionInfo.RegionName); - SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); - backup_group.RootPart.Velocity = RootPart.Velocity; - backup_group.RootPart.Acceleration = RootPart.Acceleration; - backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity; - backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem; + SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); + backup_group.RootPart.Velocity = RootPart.Velocity; + backup_group.RootPart.Acceleration = RootPart.Acceleration; + backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity; + backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem; - datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID); - HasGroupChanged = false; + datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID); + HasGroupChanged = false; - backup_group.ForEachPart(delegate(SceneObjectPart part) { part.ProcessInventoryBackup(datastore); }); + backup_group.ForEachPart(delegate(SceneObjectPart part) { part.ProcessInventoryBackup(datastore); }); - backup_group = null; + backup_group = null; + } + // else + // { + // m_log.DebugFormat( + // "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}", + // Name, UUID, IsSelected); + // } } -// else -// { -// m_log.DebugFormat( -// "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}", -// Name, UUID, IsSelected); -// } + } + catch (Exception e) + { + m_log.ErrorFormat( + "[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}", + Name, UUID, m_scene.RegionInfo.RegionName, e); } } -- cgit v1.1