From b9ef6ed0471d19e0e64330cb4020d1de26fd8f1c Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 12 Mar 2008 18:11:08 +0000 Subject: * Don't abort (and keep failing) the update if one Entity gives us an exception when we try to update it * This doesn't remove bug 757, but does largely remove the worst consequences --- OpenSim/Region/Environment/Scenes/InnerScene.cs | 15 ++++++- OpenSim/Region/Environment/Scenes/Scene.cs | 60 ++++++++++++------------- 2 files changed, 44 insertions(+), 31 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 02d0e20..7d21935 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -217,13 +217,26 @@ namespace OpenSim.Region.Environment.Scenes } } + /// + /// Process all pending updates + /// internal void ProcessUpdates() { lock (m_updateList) { for (int i = 0; i < m_updateList.Count; i++) { - m_updateList[i].Update(); + EntityBase entity = m_updateList[i]; + + // Don't abort the whole update if one entity happens to give us an exception. + try + { + m_updateList[i].Update(); + } + catch (Exception e) + { + m_log.ErrorFormat("[INNERSCENE]: Failed to update {0}, {1} - {2}", entity.Name, entity.m_uuid, e); + } } m_updateList.Clear(); } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index cc97988..1c6efd2 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -724,34 +724,34 @@ namespace OpenSim.Region.Environment.Scenes if (Region_Status != RegionStatus.SlaveScene) { - if (m_frame % m_update_events == 0) - UpdateEvents(); - - if (m_frame % m_update_backup == 0) - UpdateStorageBackup(); - - if (m_frame % m_update_terrain == 0) - UpdateTerrain(); - - if (m_frame % m_update_land == 0) - UpdateLand(); - otherMS = System.Environment.TickCount - otherMS; - // if (m_frame%m_update_avatars == 0) - // UpdateInWorldTime(); - m_statsReporter.AddPhysicsFPS(physicsFPS); - m_statsReporter.AddTimeDilation(m_timedilation); - m_statsReporter.AddFPS(1); - m_statsReporter.AddInPackets(0); - m_statsReporter.SetRootAgents(m_innerScene.GetRootAgentCount()); - m_statsReporter.SetChildAgents(m_innerScene.GetChildAgentCount()); - m_statsReporter.SetObjects(m_innerScene.GetTotalObjects()); - m_statsReporter.SetActiveObjects(m_innerScene.GetActiveObjects()); - frameMS = System.Environment.TickCount - frameMS; - m_statsReporter.addFrameMS(frameMS); - m_statsReporter.addPhysicsMS(physicsMS); - m_statsReporter.addOtherMS(otherMS); - m_statsReporter.SetActiveScripts(m_innerScene.GetActiveScripts()); - m_statsReporter.addScriptLines(m_innerScene.GetScriptLPS()); + if (m_frame % m_update_events == 0) + UpdateEvents(); + + if (m_frame % m_update_backup == 0) + UpdateStorageBackup(); + + if (m_frame % m_update_terrain == 0) + UpdateTerrain(); + + if (m_frame % m_update_land == 0) + UpdateLand(); + otherMS = System.Environment.TickCount - otherMS; + // if (m_frame%m_update_avatars == 0) + // UpdateInWorldTime(); + m_statsReporter.AddPhysicsFPS(physicsFPS); + m_statsReporter.AddTimeDilation(m_timedilation); + m_statsReporter.AddFPS(1); + m_statsReporter.AddInPackets(0); + m_statsReporter.SetRootAgents(m_innerScene.GetRootAgentCount()); + m_statsReporter.SetChildAgents(m_innerScene.GetChildAgentCount()); + m_statsReporter.SetObjects(m_innerScene.GetTotalObjects()); + m_statsReporter.SetActiveObjects(m_innerScene.GetActiveObjects()); + frameMS = System.Environment.TickCount - frameMS; + m_statsReporter.addFrameMS(frameMS); + m_statsReporter.addPhysicsMS(physicsMS); + m_statsReporter.addOtherMS(otherMS); + m_statsReporter.SetActiveScripts(m_innerScene.GetActiveScripts()); + m_statsReporter.addScriptLines(m_innerScene.GetScriptLPS()); } } catch (NotImplementedException) @@ -1288,7 +1288,7 @@ namespace OpenSim.Region.Environment.Scenes if (m_restorePresences.ContainsKey(client.AgentId)) { - m_log.Info("REGION Restore Scene Presence"); + m_log.Info("[REGION]: Restore Scene Presence"); presence = m_restorePresences[client.AgentId]; m_restorePresences.Remove(client.AgentId); @@ -1304,7 +1304,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - m_log.Info("REGION Add New Scene Presence"); + m_log.Info("[REGION]: Add New Scene Presence"); m_estateManager.sendRegionHandshake(client); -- cgit v1.1