On closing child agents, send separate asynchronous requests to each neighbour rather than sending all closes concurrently on a separate thread.

This is to reduce race conditions where neighbours may be responding erratically, thus mixing up create and close agent requests in time.
This mirrors OpenSimulator behaviour on enabling child agents where each region is contacted separately.
user_profiles
Justin Clark-Casey (justincc) 2013-05-16 17:12:02 +01:00
parent bd31821792
commit d214e2d0c4
3 changed files with 5 additions and 9 deletions

View File

@ -3440,8 +3440,8 @@ namespace OpenSim.Region.Framework.Scenes
List<ulong> regions = avatar.KnownRegionHandles;
regions.Remove(RegionInfo.RegionHandle);
// We must do this asynchronously so that a logout isn't held up where there are many present but unresponsive neighbours.
Util.FireAndForget(delegate { m_sceneGridService.SendCloseChildAgentConnections(agentID, regions); });
// This ends up being done asynchronously so that a logout isn't held up where there are many present but unresponsive neighbours.
m_sceneGridService.SendCloseChildAgentConnections(agentID, regions);
}
m_eventManager.TriggerClientClosed(agentID, this);

View File

@ -222,9 +222,7 @@ namespace OpenSim.Region.Framework.Scenes
public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst)
{
foreach (ulong handle in regionslst)
{
SendCloseChildAgent(agentID, handle);
}
Util.FireAndForget(delegate { SendCloseChildAgent(agentID, handle); });
}
public List<GridRegion> RequestNamedRegions(string name, int maxNumber)

View File

@ -3135,10 +3135,8 @@ namespace OpenSim.Region.Framework.Scenes
if (byebyeRegions.Count > 0)
{
m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents");
Util.FireAndForget(delegate
{
m_scene.SceneGridService.SendCloseChildAgentConnections(ControllingClient.AgentId, byebyeRegions);
});
}
foreach (ulong handle in byebyeRegions)