aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2015-01-21 20:31:42 +0000
committerJustin Clark-Casey (justincc)2015-01-21 20:31:42 +0000
commit155da5aad2dc0bb6d88d7276e9e3a12639cf9ead (patch)
treef636762ca16f14c1941f53abf3285200dc583413
parentFix OfflineIMEmail value overwriting every time its called. The request was r... (diff)
downloadopensim-SC_OLD-155da5aad2dc0bb6d88d7276e9e3a12639cf9ead.zip
opensim-SC_OLD-155da5aad2dc0bb6d88d7276e9e3a12639cf9ead.tar.gz
opensim-SC_OLD-155da5aad2dc0bb6d88d7276e9e3a12639cf9ead.tar.bz2
opensim-SC_OLD-155da5aad2dc0bb6d88d7276e9e3a12639cf9ead.tar.xz
Add debug ability to ignore reliably sent packets that are not acknowledged.
This is controlled via the console command "debug lludp client set process-unacked-sends true [<avatar-first-name> <avatar-last-name>]" For debug purposes to see if this process for very bad connections is causing general outbound udp processing delays. Relates to http://opensimulator.org/mantis/view.php?id=7393
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs9
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs47
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs93
3 files changed, 129 insertions, 20 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
index ce6e3ee..0394e54 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
@@ -119,8 +119,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
119 public readonly uint CircuitCode; 119 public readonly uint CircuitCode;
120 /// <summary>Sequence numbers of packets we've received (for duplicate checking)</summary> 120 /// <summary>Sequence numbers of packets we've received (for duplicate checking)</summary>
121 public readonly IncomingPacketHistoryCollection PacketArchive = new IncomingPacketHistoryCollection(200); 121 public readonly IncomingPacketHistoryCollection PacketArchive = new IncomingPacketHistoryCollection(200);
122
123 /// <summary>
124 /// If true then we take action in response to unacked reliably sent packets such as resending the packet.
125 /// </summary>
126 public bool ProcessUnackedSends { get; set; }
127
122 /// <summary>Packets we have sent that need to be ACKed by the client</summary> 128 /// <summary>Packets we have sent that need to be ACKed by the client</summary>
123 public readonly UnackedPacketCollection NeedAcks = new UnackedPacketCollection(); 129 public readonly UnackedPacketCollection NeedAcks = new UnackedPacketCollection();
130
124 /// <summary>ACKs that are queued up, waiting to be sent to the client</summary> 131 /// <summary>ACKs that are queued up, waiting to be sent to the client</summary>
125 public readonly OpenSim.Framework.LocklessQueue<uint> PendingAcks = new OpenSim.Framework.LocklessQueue<uint>(); 132 public readonly OpenSim.Framework.LocklessQueue<uint> PendingAcks = new OpenSim.Framework.LocklessQueue<uint>();
126 133
@@ -225,6 +232,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
225 if (maxRTO != 0) 232 if (maxRTO != 0)
226 m_maxRTO = maxRTO; 233 m_maxRTO = maxRTO;
227 234
235 ProcessUnackedSends = true;
236
228 // Create a token bucket throttle for this client that has the scene token bucket as a parent 237 // Create a token bucket throttle for this client that has the scene token bucket as a parent
229 m_throttleClient 238 m_throttleClient
230 = new AdaptiveTokenBucket( 239 = new AdaptiveTokenBucket(
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 4fec91f..ad83b42 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -1137,7 +1137,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1137 Utils.UIntToBytesBig(sequenceNumber, buffer.Data, 1); 1137 Utils.UIntToBytesBig(sequenceNumber, buffer.Data, 1);
1138 outgoingPacket.SequenceNumber = sequenceNumber; 1138 outgoingPacket.SequenceNumber = sequenceNumber;
1139 1139
1140 if (isReliable) 1140 if (udpClient.ProcessUnackedSends && isReliable)
1141 { 1141 {
1142 // Add this packet to the list of ACK responses we are waiting on from the server 1142 // Add this packet to the list of ACK responses we are waiting on from the server
1143 udpClient.NeedAcks.Add(outgoingPacket); 1143 udpClient.NeedAcks.Add(outgoingPacket);
@@ -1325,30 +1325,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1325 1325
1326 #region ACK Receiving 1326 #region ACK Receiving
1327 1327
1328 // Handle appended ACKs 1328 if (udpClient.ProcessUnackedSends)
1329 if (packet.Header.AppendedAcks && packet.Header.AckList != null)
1330 { 1329 {
1331// m_log.DebugFormat( 1330 // Handle appended ACKs
1332// "[LLUDPSERVER]: Handling {0} appended acks from {1} in {2}", 1331 if (packet.Header.AppendedAcks && packet.Header.AckList != null)
1333// packet.Header.AckList.Length, client.Name, m_scene.Name); 1332 {
1333 // m_log.DebugFormat(
1334 // "[LLUDPSERVER]: Handling {0} appended acks from {1} in {2}",
1335 // packet.Header.AckList.Length, client.Name, m_scene.Name);
1334 1336
1335 for (int i = 0; i < packet.Header.AckList.Length; i++) 1337 for (int i = 0; i < packet.Header.AckList.Length; i++)
1336 udpClient.NeedAcks.Acknowledge(packet.Header.AckList[i], now, packet.Header.Resent); 1338 udpClient.NeedAcks.Acknowledge(packet.Header.AckList[i], now, packet.Header.Resent);
1337 } 1339 }
1338 1340
1339 // Handle PacketAck packets 1341 // Handle PacketAck packets
1340 if (packet.Type == PacketType.PacketAck) 1342 if (packet.Type == PacketType.PacketAck)
1341 { 1343 {
1342 PacketAckPacket ackPacket = (PacketAckPacket)packet; 1344 PacketAckPacket ackPacket = (PacketAckPacket)packet;
1343 1345
1344// m_log.DebugFormat( 1346 // m_log.DebugFormat(
1345// "[LLUDPSERVER]: Handling {0} packet acks for {1} in {2}", 1347 // "[LLUDPSERVER]: Handling {0} packet acks for {1} in {2}",
1346// ackPacket.Packets.Length, client.Name, m_scene.Name); 1348 // ackPacket.Packets.Length, client.Name, m_scene.Name);
1347 1349
1348 for (int i = 0; i < ackPacket.Packets.Length; i++) 1350 for (int i = 0; i < ackPacket.Packets.Length; i++)
1349 udpClient.NeedAcks.Acknowledge(ackPacket.Packets[i].ID, now, packet.Header.Resent); 1351 udpClient.NeedAcks.Acknowledge(ackPacket.Packets[i].ID, now, packet.Header.Resent);
1350 1352
1351 // We don't need to do anything else with PacketAck packets 1353 // We don't need to do anything else with PacketAck packets
1354 return;
1355 }
1356 }
1357 else if (packet.Type == PacketType.PacketAck)
1358 {
1352 return; 1359 return;
1353 } 1360 }
1354 1361
@@ -2011,7 +2018,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2011 2018
2012 if (udpClient.IsConnected) 2019 if (udpClient.IsConnected)
2013 { 2020 {
2014 if (m_resendUnacked) 2021 if (udpClient.ProcessUnackedSends && m_resendUnacked)
2015 HandleUnacked(llClient); 2022 HandleUnacked(llClient);
2016 2023
2017 if (m_sendAcks) 2024 if (m_sendAcks)
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
index 17a394d..ac6c0b4 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
@@ -195,6 +195,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
195 "Start, stop or get status of OutgoingQueueRefillEngine.", 195 "Start, stop or get status of OutgoingQueueRefillEngine.",
196 "If stopped then refill requests are processed directly via the threadpool.", 196 "If stopped then refill requests are processed directly via the threadpool.",
197 HandleOqreCommand); 197 HandleOqreCommand);
198
199 m_console.Commands.AddCommand(
200 "Debug",
201 false,
202 "debug lludp client get",
203 "debug lludp client get [<avatar-first-name> <avatar-last-name>]",
204 "Get debug parameters for the client. If no name is given then all client information is returned.",
205 "process-unacked-sends - Do we take action if a sent reliable packet has not been acked.",
206 HandleClientGetCommand);
207
208 m_console.Commands.AddCommand(
209 "Debug",
210 false,
211 "debug lludp client set",
212 "debug lludp client set <param> <value> [<avatar-first-name> <avatar-last-name>]",
213 "Set a debug parameter for a particular client. If no name is given then the value is set on all clients.",
214 "process-unacked-sends - Do we take action if a sent reliable packet has not been acked.",
215 HandleClientSetCommand);
198 } 216 }
199 217
200 private void HandleShowServerThrottlesCommand(string module, string[] args) 218 private void HandleShowServerThrottlesCommand(string module, string[] args)
@@ -538,6 +556,81 @@ namespace OpenSim.Region.ClientStack.LindenUDP
538 m_console.OutputFormat("{0} set to {1} in {2}", param, rawValue, m_udpServer.Scene.Name); 556 m_console.OutputFormat("{0} set to {1} in {2}", param, rawValue, m_udpServer.Scene.Name);
539 } 557 }
540 558
559 private void HandleClientGetCommand(string module, string[] args)
560 {
561 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
562 return;
563
564 if (args.Length != 4 && args.Length != 6)
565 {
566 MainConsole.Instance.OutputFormat("Usage: debug lludp client get [<avatar-first-name> <avatar-last-name>]");
567 return;
568 }
569
570 string name = null;
571
572 if (args.Length == 6)
573 name = string.Format("{0} {1}", args[4], args[5]);
574
575 m_udpServer.Scene.ForEachScenePresence(
576 sp =>
577 {
578 if ((name == null || sp.Name == name) && sp.ControllingClient is LLClientView)
579 {
580 LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;
581
582 m_console.OutputFormat(
583 "Client debug parameters for {0} ({1}) in {2}",
584 sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name);
585
586 ConsoleDisplayList cdl = new ConsoleDisplayList();
587 cdl.AddRow("process-unacked-sends", udpClient.ProcessUnackedSends);
588
589 m_console.Output(cdl.ToString());
590 }
591 });
592 }
593
594 private void HandleClientSetCommand(string module, string[] args)
595 {
596 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
597 return;
598
599 if (args.Length != 6 && args.Length != 8)
600 {
601 MainConsole.Instance.OutputFormat("Usage: debug lludp client set <param> <value> [<avatar-first-name> <avatar-last-name>]");
602 return;
603 }
604
605 string param = args[4];
606 string rawValue = args[5];
607
608 string name = null;
609
610 if (args.Length == 8)
611 name = string.Format("{0} {1}", args[6], args[7]);
612
613 if (param == "process-unacked-sends")
614 {
615 bool newValue;
616
617 if (!ConsoleUtil.TryParseConsoleBool(MainConsole.Instance, rawValue, out newValue))
618 return;
619
620 m_udpServer.Scene.ForEachScenePresence(
621 sp =>
622 {
623 if ((name == null || sp.Name == name) && sp.ControllingClient is LLClientView)
624 {
625 LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;
626 udpClient.ProcessUnackedSends = newValue;
627
628 m_console.OutputFormat("{0} set to {1} for {2} in {3}", param, newValue, sp.Name, m_udpServer.Scene.Name);
629 }
630 });
631 }
632 }
633
541 private void HandlePacketCommand(string module, string[] args) 634 private void HandlePacketCommand(string module, string[] args)
542 { 635 {
543 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene) 636 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)