diff options
4 files changed, 23 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index cb653ed..6286689 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -949,6 +949,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
949 | neighbourRegion.RegionHandle); | 949 | neighbourRegion.RegionHandle); |
950 | return agent; | 950 | return agent; |
951 | } | 951 | } |
952 | // No turning back | ||
953 | agent.IsChildAgent = true; | ||
954 | |||
952 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); | 955 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); |
953 | 956 | ||
954 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); | 957 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); |
@@ -1097,7 +1100,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1097 | 1100 | ||
1098 | /// <summary> | 1101 | /// <summary> |
1099 | /// This informs all neighbouring regions about agent "avatar". | 1102 | /// This informs all neighbouring regions about agent "avatar". |
1100 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. | ||
1101 | /// </summary> | 1103 | /// </summary> |
1102 | /// <param name="sp"></param> | 1104 | /// <param name="sp"></param> |
1103 | public void EnableChildAgents(ScenePresence sp) | 1105 | public void EnableChildAgents(ScenePresence sp) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index a3dd53e..65ffe92 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -140,7 +140,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
140 | icon.EndInvoke(iar); | 140 | icon.EndInvoke(iar); |
141 | } | 141 | } |
142 | 142 | ||
143 | ExpiringCache<string, bool> _failedSims = new ExpiringCache<string, bool>(); | ||
144 | public void SendChildAgentDataUpdate(AgentPosition cAgentData, ScenePresence presence) | 143 | public void SendChildAgentDataUpdate(AgentPosition cAgentData, ScenePresence presence) |
145 | { | 144 | { |
146 | // This assumes that we know what our neighbors are. | 145 | // This assumes that we know what our neighbors are. |
@@ -158,15 +157,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
158 | Utils.LongToUInts(regionHandle, out x, out y); | 157 | Utils.LongToUInts(regionHandle, out x, out y); |
159 | GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); | 158 | GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); |
160 | bool v = true; | 159 | bool v = true; |
161 | if (! simulatorList.Contains(dest.ServerURI) && !_failedSims.TryGetValue(dest.ServerURI, out v)) | 160 | if (! simulatorList.Contains(dest.ServerURI)) |
162 | { | 161 | { |
163 | // we havent seen this simulator before, add it to the list | 162 | // we havent seen this simulator before, add it to the list |
164 | // and send it an update | 163 | // and send it an update |
165 | simulatorList.Add(dest.ServerURI); | 164 | simulatorList.Add(dest.ServerURI); |
166 | // Let move this to sync. Mono definitely does not like async networking. | 165 | // Let move this to sync. Mono definitely does not like async networking. |
167 | if (!m_scene.SimulationService.UpdateAgent(dest, cAgentData)) | 166 | m_scene.SimulationService.UpdateAgent(dest, cAgentData); |
168 | // Also if it fails, get it out of the loop for a bit | ||
169 | _failedSims.Add(dest.ServerURI, true, 120); | ||
170 | 167 | ||
171 | // Leaving this here as a reminder that we tried, and it sucks. | 168 | // Leaving this here as a reminder that we tried, and it sucks. |
172 | //SendChildAgentDataUpdateDelegate d = SendChildAgentDataUpdateAsync; | 169 | //SendChildAgentDataUpdateDelegate d = SendChildAgentDataUpdateAsync; |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b38523f..283de39 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1255,7 +1255,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1255 | { | 1255 | { |
1256 | IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); | 1256 | IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); |
1257 | if (m_agentTransfer != null) | 1257 | if (m_agentTransfer != null) |
1258 | m_agentTransfer.EnableChildAgents(this); | 1258 | Util.FireAndForget(delegate { m_agentTransfer.EnableChildAgents(this); }); |
1259 | 1259 | ||
1260 | IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>(); | 1260 | IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>(); |
1261 | if (friendsModule != null) | 1261 | if (friendsModule != null) |
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 8ab3b64..4132ec7 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -153,6 +153,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
153 | return UpdateAgent(destination, (IAgentData)data, 200000); // yes, 200 seconds | 153 | return UpdateAgent(destination, (IAgentData)data, 200000); // yes, 200 seconds |
154 | } | 154 | } |
155 | 155 | ||
156 | private ExpiringCache<string, bool> _failedSims = new ExpiringCache<string, bool>(); | ||
156 | /// <summary> | 157 | /// <summary> |
157 | /// Send updated position information about an agent in this region to a neighbor | 158 | /// Send updated position information about an agent in this region to a neighbor |
158 | /// This operation may be called very frequently if an avatar is moving about in | 159 | /// This operation may be called very frequently if an avatar is moving about in |
@@ -160,6 +161,10 @@ namespace OpenSim.Services.Connectors.Simulation | |||
160 | /// </summary> | 161 | /// </summary> |
161 | public bool UpdateAgent(GridRegion destination, AgentPosition data) | 162 | public bool UpdateAgent(GridRegion destination, AgentPosition data) |
162 | { | 163 | { |
164 | bool v = true; | ||
165 | if (_failedSims.TryGetValue(destination.ServerURI, out v)) | ||
166 | return false; | ||
167 | |||
163 | // The basic idea of this code is that the first thread that needs to | 168 | // The basic idea of this code is that the first thread that needs to |
164 | // send an update for a specific avatar becomes the worker for any subsequent | 169 | // send an update for a specific avatar becomes the worker for any subsequent |
165 | // requests until there are no more outstanding requests. Further, only send the most | 170 | // requests until there are no more outstanding requests. Further, only send the most |
@@ -183,9 +188,10 @@ namespace OpenSim.Services.Connectors.Simulation | |||
183 | // Otherwise update the reference and start processing | 188 | // Otherwise update the reference and start processing |
184 | m_updateAgentQueue[uri] = data; | 189 | m_updateAgentQueue[uri] = data; |
185 | } | 190 | } |
186 | 191 | ||
187 | AgentPosition pos = null; | 192 | AgentPosition pos = null; |
188 | while (true) | 193 | bool success = true; |
194 | while (success) | ||
189 | { | 195 | { |
190 | lock (m_updateAgentQueue) | 196 | lock (m_updateAgentQueue) |
191 | { | 197 | { |
@@ -205,11 +211,16 @@ namespace OpenSim.Services.Connectors.Simulation | |||
205 | } | 211 | } |
206 | } | 212 | } |
207 | 213 | ||
208 | UpdateAgent(destination, (IAgentData)pos, 10000); | 214 | success = UpdateAgent(destination, (IAgentData)pos, 10000); |
209 | } | 215 | } |
210 | 216 | // we get here iff success == false | |
211 | // unreachable | 217 | // blacklist sim for 2 minutes |
212 | // return true; | 218 | lock (m_updateAgentQueue) |
219 | { | ||
220 | _failedSims.AddOrUpdate(destination.ServerURI, true, 120); | ||
221 | m_updateAgentQueue.Remove(uri); | ||
222 | } | ||
223 | return false; | ||
213 | } | 224 | } |
214 | 225 | ||
215 | /// <summary> | 226 | /// <summary> |