aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-19 22:32:27 +0100
committerJustin Clark-Casey (justincc)2012-07-19 22:32:27 +0100
commitba80f137b58cfacf46fadb3ec8b63af6896c5b43 (patch)
treef7f4ff7132cac0fb35adf19cf9e35143f3eaf155 /OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
parentAdd TestCreateDuplicateRootScenePresence() regression test. (diff)
downloadopensim-SC_OLD-ba80f137b58cfacf46fadb3ec8b63af6896c5b43.zip
opensim-SC_OLD-ba80f137b58cfacf46fadb3ec8b63af6896c5b43.tar.gz
opensim-SC_OLD-ba80f137b58cfacf46fadb3ec8b63af6896c5b43.tar.bz2
opensim-SC_OLD-ba80f137b58cfacf46fadb3ec8b63af6896c5b43.tar.xz
Prevent race conditions between two threads that call LLClientView.Close() simultaneously (e.g. ack timeout and an attempt to reconnect)
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs29
1 files changed, 14 insertions, 15 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 097f109..746eb90 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -1123,22 +1123,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1123 /// regular client pings. 1123 /// regular client pings.
1124 /// </remarks> 1124 /// </remarks>
1125 /// <param name='client'></param> 1125 /// <param name='client'></param>
1126 private void DeactivateClientDueToTimeout(IClientAPI client) 1126 private void DeactivateClientDueToTimeout(LLClientView client)
1127 { 1127 {
1128 // We must set IsActive synchronously so that we can stop the packet loop reinvoking this method, even 1128 lock (client.CloseSyncLock)
1129 // though it's set later on by LLClientView.Close() 1129 {
1130 client.IsActive = false; 1130 m_log.WarnFormat(
1131 1131 "[LLUDPSERVER]: Ack timeout, disconnecting {0} agent for {1} in {2}",
1132 m_log.WarnFormat( 1132 client.SceneAgent.IsChildAgent ? "child" : "root", client.Name, m_scene.RegionInfo.RegionName);
1133 "[LLUDPSERVER]: Ack timeout, disconnecting {0} agent for {1} in {2}", 1133
1134 client.SceneAgent.IsChildAgent ? "child" : "root", client.Name, m_scene.RegionInfo.RegionName); 1134 StatsManager.SimExtraStats.AddAbnormalClientThreadTermination();
1135 1135
1136 StatsManager.SimExtraStats.AddAbnormalClientThreadTermination(); 1136 if (!client.SceneAgent.IsChildAgent)
1137 1137 client.Kick("Simulator logged you out due to connection timeout");
1138 if (!client.SceneAgent.IsChildAgent) 1138
1139 client.Kick("Simulator logged you out due to connection timeout"); 1139 client.CloseWithoutChecks();
1140 1140 }
1141 client.Close();
1142 } 1141 }
1143 1142
1144 private void IncomingPacketHandler() 1143 private void IncomingPacketHandler()