Mantis #7858: DeleteSceneObject done slightly differently. ProcessEntities now checks whether the objects have been deleted and, if so, sends an extra kill object packet, in order to compensate for potential race conditions encountered by the first one.

Note: I still cannot reproduce this problem, but I was able to emulate it by adding an artificial delay on ProcessEntities, which did, indeed, result in objects not being deleted. This fix fixed my emulated scenario.
LSLKeyTest
Diva Canto 2016-06-12 12:23:52 -07:00
parent 9ebdae8676
commit 42a9afdc43
3 changed files with 34 additions and 9 deletions

View File

@ -357,7 +357,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// All manipulation of this set has to occur under an m_entityUpdates.SyncRoot lock /// All manipulation of this set has to occur under an m_entityUpdates.SyncRoot lock
/// ///
/// </value> /// </value>
// protected HashSet<uint> m_killRecord; protected List<uint> m_killRecord;
// protected HashSet<uint> m_attachmentsSent; // protected HashSet<uint> m_attachmentsSent;
@ -509,7 +509,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_entityUpdates = new PriorityQueue(m_scene.Entities.Count); m_entityUpdates = new PriorityQueue(m_scene.Entities.Count);
m_entityProps = new PriorityQueue(m_scene.Entities.Count); m_entityProps = new PriorityQueue(m_scene.Entities.Count);
m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>(); m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>();
// m_killRecord = new HashSet<uint>(); m_killRecord = new List<uint>();
// m_attachmentsSent = new HashSet<uint>(); // m_attachmentsSent = new HashSet<uint>();
m_assetService = m_scene.RequestModuleInterface<IAssetService>(); m_assetService = m_scene.RequestModuleInterface<IAssetService>();
@ -4005,6 +4005,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>();
OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>();
// Check to see if this is a flush // Check to see if this is a flush
if (maxUpdates <= 0) if (maxUpdates <= 0)
{ {
@ -4033,9 +4034,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
SceneObjectPart part = (SceneObjectPart)update.Entity; SceneObjectPart part = (SceneObjectPart)update.Entity;
if (part.ParentGroup.IsDeleted || part.ParentGroup.inTransit) if (part.ParentGroup.inTransit)
continue; continue;
if (part.ParentGroup.IsDeleted)
{
// Don't send updates for objects that have been marked deleted.
// Instead send another kill object, because the first one may have gotten
// into a race condition
if (!m_killRecord.Contains(part.ParentGroup.LocalId))
m_killRecord.Add(part.ParentGroup.LocalId);
continue;
}
if (part.ParentGroup.IsAttachment) if (part.ParentGroup.IsAttachment)
{ // Someone else's HUD, why are we getting these? { // Someone else's HUD, why are we getting these?
if (part.ParentGroup.OwnerID != AgentId && part.ParentGroup.HasPrivateAttachmentPoint) if (part.ParentGroup.OwnerID != AgentId && part.ParentGroup.HasPrivateAttachmentPoint)
@ -4270,6 +4281,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
#endregion Packet Sending #endregion Packet Sending
#region Handle deleted objects
if (m_killRecord.Count > 0)
{
SendKillObject(m_killRecord);
m_killRecord.Clear();
}
#endregion
} }
// hack.. dont use // hack.. dont use

View File

@ -1987,6 +1987,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
// We need to keep track of this state in case this group is still queued for backup. // We need to keep track of this state in case this group is still queued for backup.
IsDeleted = true; IsDeleted = true;
HasGroupChanged = true;
DetachFromBackup(); DetachFromBackup();
@ -2010,7 +2011,13 @@ namespace OpenSim.Region.Framework.Scenes
if (!IsAttachment if (!IsAttachment
|| AttachedAvatar == avatar.ControllingClient.AgentId || AttachedAvatar == avatar.ControllingClient.AgentId
|| !HasPrivateAttachmentPoint) || !HasPrivateAttachmentPoint)
{
// Send a kill object immediately
avatar.ControllingClient.SendKillObject(new List<uint> { part.LocalId }); avatar.ControllingClient.SendKillObject(new List<uint> { part.LocalId });
// Also, send a terse update; in case race conditions make the object pop again in the client,
// this update will send another kill object
m_rootPart.SendTerseUpdateToClient(avatar.ControllingClient);
}
} }
} }
}); });

View File

@ -5390,9 +5390,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
public void SendTerseUpdateToClient(IClientAPI remoteClient) public void SendTerseUpdateToClient(IClientAPI remoteClient)
{ {
if (ParentGroup.IsDeleted)
return;
if (ParentGroup.IsAttachment if (ParentGroup.IsAttachment
&& (ParentGroup.RootPart != this && (ParentGroup.RootPart != this
|| ParentGroup.AttachedAvatar != remoteClient.AgentId && ParentGroup.HasPrivateAttachmentPoint)) || ParentGroup.AttachedAvatar != remoteClient.AgentId && ParentGroup.HasPrivateAttachmentPoint))