Remove the call to remove tokens from the parent. Under heavy load
this appears to cause problems with the system timer resolution. This caused a problem with tokens going into the root throttle as bursts leading to some starvation. Also changed EnqueueOutgoing to always queue a packet if there are already packets in the queue. Ensures consistent ordering of packet sends.bulletsim
parent
22b307ea1c
commit
3e0e1057ac
|
@ -440,6 +440,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category];
|
OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category];
|
||||||
TokenBucket bucket = m_throttleCategories[category];
|
TokenBucket bucket = m_throttleCategories[category];
|
||||||
|
|
||||||
|
// Don't send this packet if there is already a packet waiting in the queue
|
||||||
|
// even if we have the tokens to send it, tokens should go to the already
|
||||||
|
// queued packets
|
||||||
|
if (queue.Count > 0)
|
||||||
|
{
|
||||||
|
queue.Enqueue(packet);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!forceQueue && bucket.RemoveTokens(packet.Buffer.DataLength))
|
if (!forceQueue && bucket.RemoveTokens(packet.Buffer.DataLength))
|
||||||
{
|
{
|
||||||
// Enough tokens were removed from the bucket, the packet will not be queued
|
// Enough tokens were removed from the bucket, the packet will not be queued
|
||||||
|
|
|
@ -255,12 +255,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
// If we have enough tokens then remove them and return
|
// If we have enough tokens then remove them and return
|
||||||
if (m_tokenCount - amount >= 0)
|
if (m_tokenCount - amount >= 0)
|
||||||
{
|
{
|
||||||
if (m_parent == null || m_parent.RemoveTokens(amount))
|
// we don't have to remove from the parent, the drip rate is already
|
||||||
{
|
// reflective of the drip rate limits in the parent
|
||||||
m_tokenCount -= amount;
|
m_tokenCount -= amount;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue