From 66b1c37973e5ec34cc0c700b7dac9c767f8301ff Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 21 Nov 2014 21:34:18 +0000 Subject: Fix bug in HG attachment throttling code where attachments were never rezzed on any teleport within a foreign grid after the first. Bug was introduced in ghosts branch commit 69abade --- .../EntityTransfer/HGEntityTransferModule.cs | 118 +++++++++++---------- 1 file changed, 63 insertions(+), 55 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 7e356ea..97267c1 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -583,81 +583,89 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // foreign user AgentCircuitData aCircuit = Scene.AuthenticateHandler.GetAgentCircuitData(so.OwnerID); - if (aCircuit != null && (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0) + if (aCircuit != null) { - if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) + if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) == 0) { - m_incomingSceneObjectEngine.QueueRequest( - string.Format("HG UUID Gather for attachment {0} for {1}", so.Name, aCircuit.Name), - so.OwnerID.ToString(), - o => - { - string url = aCircuit.ServiceURLs["AssetServerURI"].ToString(); -// m_log.DebugFormat( -// "[HG ENTITY TRANSFER MODULE]: Incoming attachment {0} for HG user {1} with asset service {2}", -// so.Name, so.AttachedAvatar, url); + // We have already pulled the necessary attachments from the source grid. + base.HandleIncomingSceneObject(so, newPosition); + } + else + { + if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) + { + m_incomingSceneObjectEngine.QueueRequest( + string.Format("HG UUID Gather for attachment {0} for {1}", so.Name, aCircuit.Name), + so.OwnerID.ToString(), + o => + { + string url = aCircuit.ServiceURLs["AssetServerURI"].ToString(); + // m_log.DebugFormat( + // "[HG ENTITY TRANSFER MODULE]: Incoming attachment {0} for HG user {1} with asset service {2}", + // so.Name, so.AttachedAvatar, url); - IteratingHGUuidGatherer uuidGatherer = new IteratingHGUuidGatherer(Scene.AssetService, url); - uuidGatherer.RecordAssetUuids(so); + IteratingHGUuidGatherer uuidGatherer = new IteratingHGUuidGatherer(Scene.AssetService, url); + uuidGatherer.RecordAssetUuids(so); - while (!uuidGatherer.Complete) - { - int tickStart = Util.EnvironmentTickCount(); + while (!uuidGatherer.Complete) + { + int tickStart = Util.EnvironmentTickCount(); - UUID? nextUuid = uuidGatherer.NextUuidToInspect; - uuidGatherer.GatherNext(); + UUID? nextUuid = uuidGatherer.NextUuidToInspect; + uuidGatherer.GatherNext(); -// m_log.DebugFormat( -// "[HG ENTITY TRANSFER]: Gathered attachment asset uuid {0} for object {1} for HG user {2} took {3} ms with asset service {4}", -// nextUuid, so.Name, so.OwnerID, Util.EnvironmentTickCountSubtract(tickStart), url); + // m_log.DebugFormat( + // "[HG ENTITY TRANSFER]: Gathered attachment asset uuid {0} for object {1} for HG user {2} took {3} ms with asset service {4}", + // nextUuid, so.Name, so.OwnerID, Util.EnvironmentTickCountSubtract(tickStart), url); - int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); + int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); - if (ticksElapsed > 30000) - { - m_log.WarnFormat( - "[HG ENTITY TRANSFER]: Removing incoming scene object jobs for HG user {0} as gather of {1} from {2} took {3} ms to respond (> {4} ms)", - so.OwnerID, so.Name, url, ticksElapsed, 30000); + if (ticksElapsed > 30000) + { + m_log.WarnFormat( + "[HG ENTITY TRANSFER]: Removing incoming scene object jobs for HG user {0} as gather of {1} from {2} took {3} ms to respond (> {4} ms)", + so.OwnerID, so.Name, url, ticksElapsed, 30000); - RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); + RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); - return; - } - } + return; + } + } - IDictionary ids = uuidGatherer.GetGatheredUuids(); + IDictionary ids = uuidGatherer.GetGatheredUuids(); -// m_log.DebugFormat( -// "[HG ENTITY TRANSFER]: Fetching {0} assets for attachment {1} for HG user {2} with asset service {3}", -// ids.Count, so.Name, so.OwnerID, url); + // m_log.DebugFormat( + // "[HG ENTITY TRANSFER]: Fetching {0} assets for attachment {1} for HG user {2} with asset service {3}", + // ids.Count, so.Name, so.OwnerID, url); - foreach (KeyValuePair kvp in ids) - { - int tickStart = Util.EnvironmentTickCount(); + foreach (KeyValuePair kvp in ids) + { + int tickStart = Util.EnvironmentTickCount(); - uuidGatherer.FetchAsset(kvp.Key); + uuidGatherer.FetchAsset(kvp.Key); - int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); + int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); - if (ticksElapsed > 30000) - { - m_log.WarnFormat( - "[HG ENTITY TRANSFER]: Removing incoming scene object jobs for HG user {0} as fetch of {1} from {2} took {3} ms to respond (> {4} ms)", - so.OwnerID, kvp.Key, url, ticksElapsed, 30000); + if (ticksElapsed > 30000) + { + m_log.WarnFormat( + "[HG ENTITY TRANSFER]: Removing incoming scene object jobs for HG user {0} as fetch of {1} from {2} took {3} ms to respond (> {4} ms)", + so.OwnerID, kvp.Key, url, ticksElapsed, 30000); - RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); + RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); - return; - } - } + return; + } + } - base.HandleIncomingSceneObject(so, newPosition); + base.HandleIncomingSceneObject(so, newPosition); -// m_log.DebugFormat( -// "[HG ENTITY TRANSFER MODULE]: Completed incoming attachment {0} for HG user {1} with asset server {2}", -// so.Name, so.OwnerID, url); - }, - null); + // m_log.DebugFormat( + // "[HG ENTITY TRANSFER MODULE]: Completed incoming attachment {0} for HG user {1} with asset server {2}", + // so.Name, so.OwnerID, url); + }, + null); + } } } -- cgit v1.1