From b290ce405f01ae4b52ba5d5ec1661a2ae44ba2d6 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Sat, 21 Jun 2008 19:56:19 +0000
Subject: * Remove a bug I created in r5171 where taking an object would
terminate the client session * change code to use an explicit state variable
instead of using SOG.Name = null to signal deletion
---
OpenSim/Region/Environment/Scenes/EntityBase.cs | 9 +++++++++
OpenSim/Region/Environment/Scenes/InnerScene.cs | 8 +++++---
OpenSim/Region/Environment/Scenes/Scene.cs | 10 +---------
OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 11 +++++++++--
4 files changed, 24 insertions(+), 14 deletions(-)
(limited to 'OpenSim/Region/Environment/Scenes')
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs
index 1970896..bc3e06c 100644
--- a/OpenSim/Region/Environment/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs
@@ -63,6 +63,15 @@ namespace OpenSim.Region.Environment.Scenes
get { return m_name; }
set { m_name = value; }
}
+
+ ///
+ /// Signals whether this group was in a scene but has since been deleted from it.
+ ///
+ public bool IsDeleted
+ {
+ get { return m_isDeleted; }
+ }
+ protected bool m_isDeleted;
protected LLVector3 m_pos;
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index e803122..7529d77 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -293,21 +293,23 @@ namespace OpenSim.Region.Environment.Scenes
// Don't abort the whole update if one entity happens to give us an exception.
try
{
- // A null name signals that this group was deleted before the scheduled update
+ // Check that the group was not deleted before the scheduled update
// FIXME: This is merely a temporary measure to reduce the incidence of failure, when
// an object has been deleted from a scene before update was processed.
// A more fundamental overhaul of the update mechanism is required to eliminate all
// the race conditions.
- if (entity.Name != null)
+ if (!entity.IsDeleted)
{
m_updateList[i].Update();
}
}
catch (Exception e)
{
- m_log.ErrorFormat("[INNER SCENE]: Failed to update {0}, - {1}", entity.Name, e);//entity.m_uuid
+ m_log.ErrorFormat(
+ "[INNER SCENE]: Failed to update {0}, {1} - {2}", entity.Name, entity.UUID, e);
}
}
+
m_updateList.Clear();
}
}
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 73b3a49..aa74072 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1665,7 +1665,7 @@ namespace OpenSim.Region.Environment.Scenes
}
///
- /// Delete this object from the scene.
+ /// Delete the given object from the scene.
///
///
public void DeleteSceneObject(SceneObjectGroup group)
@@ -1686,14 +1686,6 @@ namespace OpenSim.Region.Environment.Scenes
group.DeleteGroup();
group.DeleteParts();
-
- // In case anybody else retains a reference to this group, signal deletion by changing the name
- // to null. We can't zero out the UUID because this is taken from the root part, which has already
- // been removed.
- // FIXME: This is a really poor temporary solution, since it still leaves plenty of scope for race
- // conditions where a user deletes an entity while it is being stored. Really, the update
- // code needs a redesign.
- group.Name = null;
}
///
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 0d759cf..814db05 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Scenes
{
get { return RootPart.Name; }
set { RootPart.Name = value; }
- }
+ }
///
/// Added because the Parcel code seems to use it
@@ -921,10 +921,16 @@ namespace OpenSim.Region.Environment.Scenes
}
///
- /// Completely delete this group and tell all the scene presences about that deletion.
+ /// Delete this group from its scene and tell all the scene presences about that deletion.
///
public void DeleteGroup()
{
+ // We need to keep track of this state in case this group is still queued for backup.
+ // FIXME: This is a poor temporary solution, since it still leaves plenty of scope for race
+ // conditions where a user deletes an entity while it is being stored. Really, the update
+ // code needs a redesign.
+ m_isDeleted = true;
+
DetachFromBackup(this);
lock (m_parts)
@@ -944,6 +950,7 @@ namespace OpenSim.Region.Environment.Scenes
}
}
}
+
public void FakeDeleteGroup()
{
foreach (SceneObjectPart part in m_parts.Values)
--
cgit v1.1