* 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
0.6.0-stable
Justin Clarke Casey 2008-09-16 17:30:30 +00:00
parent 0b52453762
commit ec4189b722
2 changed files with 33 additions and 23 deletions

View File

@ -885,7 +885,6 @@ namespace OpenSim.Region.Environment.Scenes
{ {
EventManager.TriggerOnBackup(m_storageManager.DataStore); EventManager.TriggerOnBackup(m_storageManager.DataStore);
m_backingup = false; m_backingup = false;
//return true;
} }
#endregion #endregion

View File

@ -1124,39 +1124,50 @@ namespace OpenSim.Region.Environment.Scenes
#region Events #region Events
/// <summary> /// <summary>
/// Processes backup /// Processes backup.
/// </summary> /// </summary>
/// <param name="datastore"></param> /// <param name="datastore"></param>
public void ProcessBackup(IRegionDataStore datastore) 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 (HasGroupChanged)
if ((!IsSelected) && (RootPart != null))
{ {
m_log.InfoFormat( // don't backup while it's selected or you're asking for changes mid stream.
"[SCENE]: Storing object {0}, {1} in {2}", if ((!IsSelected) && (RootPart != null))
Name, UUID, m_scene.RegionInfo.RegionName); {
m_log.InfoFormat(
"[SCENE]: Storing {0}, {1} in {2}",
Name, UUID, m_scene.RegionInfo.RegionName);
SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false);
backup_group.RootPart.Velocity = RootPart.Velocity; backup_group.RootPart.Velocity = RootPart.Velocity;
backup_group.RootPart.Acceleration = RootPart.Acceleration; backup_group.RootPart.Acceleration = RootPart.Acceleration;
backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity; backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem; backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem;
datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID); datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
HasGroupChanged = false; 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 }
// { catch (Exception e)
// m_log.DebugFormat( {
// "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}", m_log.ErrorFormat(
// Name, UUID, IsSelected); "[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}",
// } Name, UUID, m_scene.RegionInfo.RegionName, e);
} }
} }