aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2011-02-08 20:12:33 -0800
committerDiva Canto2011-02-08 20:12:33 -0800
commit585473aade100c3ffeef27e0c8e6b6c8c09d0109 (patch)
tree23421676ce3aa4b06e577d5854a362278fd79890 /OpenSim
parentAvoid potential race conditions on UseCircuitCode. I artificially made the ra... (diff)
downloadopensim-SC_OLD-585473aade100c3ffeef27e0c8e6b6c8c09d0109.zip
opensim-SC_OLD-585473aade100c3ffeef27e0c8e6b6c8c09d0109.tar.gz
opensim-SC_OLD-585473aade100c3ffeef27e0c8e6b6c8c09d0109.tar.bz2
opensim-SC_OLD-585473aade100c3ffeef27e0c8e6b6c8c09d0109.tar.xz
Brute-force debug -- mantis #5365
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs18
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs5
2 files changed, 20 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index 65a8fe3..2d58b94 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -463,12 +463,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
463 bool packetSent = false; 463 bool packetSent = false;
464 ThrottleOutPacketTypeFlags emptyCategories = 0; 464 ThrottleOutPacketTypeFlags emptyCategories = 0;
465 465
466 //string queueDebugOutput = String.Empty; // Serious debug business 466 string queueDebugOutput = String.Empty; // Serious debug business
467 467
468 for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++) 468 for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++)
469 { 469 {
470 bucket = m_throttleCategories[i]; 470 bucket = m_throttleCategories[i];
471 //queueDebugOutput += m_packetOutboxes[i].Count + " "; // Serious debug business 471 if (i == 4)
472 queueDebugOutput += m_packetOutboxes[i].Count + " "; // Serious debug business
472 473
473 if (m_nextPackets[i] != null) 474 if (m_nextPackets[i] != null)
474 { 475 {
@@ -476,13 +477,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
476 // leaving a dequeued packet still waiting to be sent out. Try to 477 // leaving a dequeued packet still waiting to be sent out. Try to
477 // send it again 478 // send it again
478 OutgoingPacket nextPacket = m_nextPackets[i]; 479 OutgoingPacket nextPacket = m_nextPackets[i];
480 if (i == 4) queueDebugOutput += "m_nextPackets[i] != null, " + nextPacket.Buffer.DataLength;
479 if (bucket.RemoveTokens(nextPacket.Buffer.DataLength)) 481 if (bucket.RemoveTokens(nextPacket.Buffer.DataLength))
480 { 482 {
483 if (i == 4) queueDebugOutput += " removed tokens ";
481 // Send the packet 484 // Send the packet
482 m_udpServer.SendPacketFinal(nextPacket); 485 m_udpServer.SendPacketFinal(nextPacket);
483 m_nextPackets[i] = null; 486 m_nextPackets[i] = null;
484 packetSent = true; 487 packetSent = true;
485 } 488 }
489 else
490 if (i == 4) queueDebugOutput += " did not remove tokens ";
486 } 491 }
487 else 492 else
488 { 493 {
@@ -491,6 +496,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
491 queue = m_packetOutboxes[i]; 496 queue = m_packetOutboxes[i];
492 if (queue.Dequeue(out packet)) 497 if (queue.Dequeue(out packet))
493 { 498 {
499 if (i == 4) queueDebugOutput += "m_nextPackets[i] == null, dq ok " + packet.Buffer.DataLength;
494 // A packet was pulled off the queue. See if we have 500 // A packet was pulled off the queue. See if we have
495 // enough tokens in the bucket to send it out 501 // enough tokens in the bucket to send it out
496 if (bucket.RemoveTokens(packet.Buffer.DataLength)) 502 if (bucket.RemoveTokens(packet.Buffer.DataLength))
@@ -498,11 +504,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
498 // Send the packet 504 // Send the packet
499 m_udpServer.SendPacketFinal(packet); 505 m_udpServer.SendPacketFinal(packet);
500 packetSent = true; 506 packetSent = true;
507 if (i == 4) queueDebugOutput += " removed tokens ";
501 } 508 }
502 else 509 else
503 { 510 {
504 // Save the dequeued packet for the next iteration 511 // Save the dequeued packet for the next iteration
505 m_nextPackets[i] = packet; 512 m_nextPackets[i] = packet;
513 if (i == 4) queueDebugOutput += " did not remove tokens ";
506 } 514 }
507 515
508 // If the queue is empty after this dequeue, fire the queue 516 // If the queue is empty after this dequeue, fire the queue
@@ -513,17 +521,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
513 } 521 }
514 else 522 else
515 { 523 {
524 if (i == 4) queueDebugOutput += "m_nextPackets[i] == null, dq nok ";
516 // No packets in this queue. Fire the queue empty callback 525 // No packets in this queue. Fire the queue empty callback
517 // if it has not been called recently 526 // if it has not been called recently
518 emptyCategories |= CategoryToFlag(i); 527 emptyCategories |= CategoryToFlag(i);
519 } 528 }
520 } 529 }
530
521 } 531 }
522 532
523 if (emptyCategories != 0) 533 if (emptyCategories != 0)
524 BeginFireQueueEmpty(emptyCategories); 534 BeginFireQueueEmpty(emptyCategories);
525 535
526 //m_log.Info("[LLUDPCLIENT]: Queues: " + queueDebugOutput); // Serious debug business 536 if (m_udpServer.EmergencyMonitoring)
537 m_log.Info("[LLUDPCLIENT]: Queues: " + queueDebugOutput); // Serious debug business
538
527 return packetSent; 539 return packetSent;
528 } 540 }
529 541
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 04fec95..922e2bc 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -1133,6 +1133,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1133 private int npacksSent = 0; 1133 private int npacksSent = 0;
1134 private int npackNotSent = 0; 1134 private int npackNotSent = 0;
1135 1135
1136 public bool EmergencyMonitoring
1137 {
1138 get { return m_scene.EmergencyMonitoring; }
1139 }
1140
1136 private void MonitoredClientOutgoingPacketHandler(IClientAPI client) 1141 private void MonitoredClientOutgoingPacketHandler(IClientAPI client)
1137 { 1142 {
1138 nticks++; 1143 nticks++;