Further tweaks on TPs: not sending the callback URL and instead waiting 15sec before closing the agent. This seems to be working fairly well. The viewer seems to have an 8 sec delay between UseCircuitCode and CompleteMovement.

Also added back the position on UpdateAgent, because it's needed for TPing between neighboring regions.
cpu-performance
Diva Canto 2013-07-21 20:22:13 -07:00
parent 8d98d287bd
commit 37337a4de9
4 changed files with 33 additions and 27 deletions

View File

@ -684,6 +684,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
} }
//sp.ControllingClient.SendTeleportProgress(teleportFlags, "Contacting destination...");
// Let's create an agent there if one doesn't exist yet. // Let's create an agent there if one doesn't exist yet.
// NOTE: logout will always be false for a non-HG teleport. // NOTE: logout will always be false for a non-HG teleport.
bool logout = false; bool logout = false;
@ -724,8 +726,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Past this point we have to attempt clean up if the teleport fails, so update transfer state. // Past this point we have to attempt clean up if the teleport fails, so update transfer state.
m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring); m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring);
// OK, it got this agent. Let's close some child agents #region old protocol
sp.CloseChildAgents(newRegionX, newRegionY);
IClientIPEndpoint ipepClient; IClientIPEndpoint ipepClient;
if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
@ -775,11 +776,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
} }
#endregion old protocol
// Let's send a full update of the agent. This is a synchronous call. // Let's send a full update of the agent. This is a synchronous call.
AgentData agent = new AgentData(); AgentData agent = new AgentData();
sp.CopyTo(agent); sp.CopyTo(agent);
agent.Position = position; agent.Position = position;
SetCallbackURL(agent, sp.Scene.RegionInfo); //SetCallbackURL(agent, sp.Scene.RegionInfo);
//sp.ControllingClient.SendTeleportProgress(teleportFlags, "Updating agent..."); //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Updating agent...");
@ -801,6 +804,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// closes our existing agent which is still signalled as root. // closes our existing agent which is still signalled as root.
sp.IsChildAgent = true; sp.IsChildAgent = true;
// New protocol: send TP Finish directly, without prior ES or EAC. That's what happens in the Linden grid
if (m_eqModule != null) if (m_eqModule != null)
{ {
m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID); m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID);
@ -853,30 +857,30 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
"[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}", "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}",
capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); capsPath, sp.Scene.RegionInfo.RegionName, sp.Name);
// TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which //// TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which
// trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation //// trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation
// that the client contacted the destination before we close things here. //// that the client contacted the destination before we close things here.
if (!m_entityTransferStateMachine.WaitForAgentArrivedAtDestination(sp.UUID)) //if (!m_entityTransferStateMachine.WaitForAgentArrivedAtDestination(sp.UUID))
{ //{
if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) // if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting)
{ // {
m_interRegionTeleportAborts.Value++; // m_interRegionTeleportAborts.Value++;
m_log.DebugFormat( // m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after WaitForAgentArrivedAtDestination due to previous client close.", // "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after WaitForAgentArrivedAtDestination due to previous client close.",
sp.Name, finalDestination.RegionName, sp.Scene.Name); // sp.Name, finalDestination.RegionName, sp.Scene.Name);
return; // return;
} // }
m_log.WarnFormat( // m_log.WarnFormat(
"[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} from {2} failed due to no callback from destination region. Returning avatar to source region.", // "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} from {2} failed due to no callback from destination region. Returning avatar to source region.",
sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); // sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName);
Fail(sp, finalDestination, logout, currentAgentCircuit.SessionID.ToString(), "Destination region did not signal teleport completion."); // Fail(sp, finalDestination, logout, currentAgentCircuit.SessionID.ToString(), "Destination region did not signal teleport completion.");
return; // return;
} //}
m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
@ -897,6 +901,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Now let's make it officially a child agent // Now let's make it officially a child agent
sp.MakeChildAgent(); sp.MakeChildAgent();
// OK, it got this agent. Let's close some child agents
sp.CloseChildAgents(newRegionX, newRegionY);
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
@ -907,7 +914,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// //
// This sleep can be increased if necessary. However, whilst it's active, // This sleep can be increased if necessary. However, whilst it's active,
// an agent cannot teleport back to this region if it has teleported away. // an agent cannot teleport back to this region if it has teleported away.
Thread.Sleep(2000); Thread.Sleep(15000);
sp.Scene.IncomingCloseAgent(sp.UUID, false); sp.Scene.IncomingCloseAgent(sp.UUID, false);
} }

View File

@ -79,7 +79,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
public void OnConnectionClose(IClientAPI client) public void OnConnectionClose(IClientAPI client)
{ {
if (!client.SceneAgent.IsChildAgent) if (client != null && client.SceneAgent != null && !client.SceneAgent.IsChildAgent)
{ {
// m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); // m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName);
m_PresenceService.LogoutAgent(client.SessionId); m_PresenceService.LogoutAgent(client.SessionId);

View File

@ -4254,7 +4254,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name='agentID'></param> /// <param name='agentID'></param>
protected virtual ScenePresence WaitGetScenePresence(UUID agentID) protected virtual ScenePresence WaitGetScenePresence(UUID agentID)
{ {
int ntimes = 10; int ntimes = 20;
ScenePresence sp = null; ScenePresence sp = null;
while ((sp = GetScenePresence(agentID)) == null && (ntimes-- > 0)) while ((sp = GetScenePresence(agentID)) == null && (ntimes-- > 0))
Thread.Sleep(1000); Thread.Sleep(1000);

View File

@ -3369,9 +3369,8 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE PRESENCE]: Set callback for {0} in {1} to {2} in CopyFrom()", // "[SCENE PRESENCE]: Set callback for {0} in {1} to {2} in CopyFrom()",
// Name, m_scene.RegionInfo.RegionName, m_callbackURI); // Name, m_scene.RegionInfo.RegionName, m_callbackURI);
// Don't copy the agent position
m_pos = cAgent.Position;
m_velocity = cAgent.Velocity; m_velocity = cAgent.Velocity;
CameraPosition = cAgent.Center; CameraPosition = cAgent.Center;
CameraAtAxis = cAgent.AtAxis; CameraAtAxis = cAgent.AtAxis;