* Transport: Back out CoDel for SSU PeerState and NTCP

This commit is contained in:
zzz
2012-10-20 11:37:31 +00:00
parent 5695d0e94a
commit e329742c8d
4 changed files with 20 additions and 8 deletions

View File

@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 16;
public final static long BUILD = 17;
/** for example "-test" */
public final static String EXTRA = "-rc";

View File

@@ -27,6 +27,7 @@ import net.i2p.router.Router;
import net.i2p.router.RouterContext;
import net.i2p.router.transport.FIFOBandwidthLimiter;
import net.i2p.router.util.CoDelPriorityBlockingQueue;
import net.i2p.router.util.PriBlockingQueue;
import net.i2p.util.ConcurrentHashSet;
import net.i2p.util.HexDump;
import net.i2p.util.Log;
@@ -86,7 +87,8 @@ class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener {
/**
* pending unprepared OutNetMessage instances
*/
private final CoDelPriorityBlockingQueue<OutNetMessage> _outbound;
//private final CoDelPriorityBlockingQueue<OutNetMessage> _outbound;
private final PriBlockingQueue<OutNetMessage> _outbound;
/**
* current prepared OutNetMessage, or null - synchronize on _outbound to modify
* FIXME why do we need this???
@@ -155,7 +157,8 @@ class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener {
_readBufs = new ConcurrentLinkedQueue();
_writeBufs = new ConcurrentLinkedQueue();
_bwRequests = new ConcurrentHashSet(2);
_outbound = new CoDelPriorityBlockingQueue(ctx, "NTCP-Connection", 32);
//_outbound = new CoDelPriorityBlockingQueue(ctx, "NTCP-Connection", 32);
_outbound = new PriBlockingQueue(32);
_isInbound = true;
_decryptBlockBuf = new byte[BLOCK_SIZE];
_curReadState = new ReadState();
@@ -179,7 +182,8 @@ class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener {
_readBufs = new ConcurrentLinkedQueue();
_writeBufs = new ConcurrentLinkedQueue();
_bwRequests = new ConcurrentHashSet(8);
_outbound = new CoDelPriorityBlockingQueue(ctx, "NTCP-Connection", 32);
//_outbound = new CoDelPriorityBlockingQueue(ctx, "NTCP-Connection", 32);
_outbound = new PriBlockingQueue(32);
_isInbound = false;
_decryptBlockBuf = new byte[BLOCK_SIZE];
_curReadState = new ReadState();
@@ -297,7 +301,8 @@ class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener {
}
List<OutNetMessage> pending = new ArrayList();
_outbound.drainAllTo(pending);
//_outbound.drainAllTo(pending);
_outbound.drainTo(pending);
for (OutNetMessage msg : pending) {
Object buf = msg.releasePreparationBuffer();
if (buf != null)

View File

@@ -17,6 +17,7 @@ import net.i2p.data.SessionKey;
import net.i2p.router.OutNetMessage;
import net.i2p.router.RouterContext;
import net.i2p.router.util.CoDelPriorityBlockingQueue;
import net.i2p.router.util.PriBlockingQueue;
import net.i2p.util.Log;
import net.i2p.util.ConcurrentHashSet;
@@ -209,7 +210,8 @@ class PeerState {
* Priority queue of messages that have not yet been sent.
* They are taken from here and put in _outboundMessages.
*/
private final CoDelPriorityBlockingQueue<OutboundMessageState> _outboundQueue;
//private final CoDelPriorityBlockingQueue<OutboundMessageState> _outboundQueue;
private final PriBlockingQueue<OutboundMessageState> _outboundQueue;
/** which outbound message is currently being retransmitted */
private OutboundMessageState _retransmitter;
@@ -323,7 +325,8 @@ class PeerState {
_rttDeviation = _rtt;
_inboundMessages = new HashMap(8);
_outboundMessages = new ArrayList(32);
_outboundQueue = new CoDelPriorityBlockingQueue(ctx, "UDP-PeerState", 32);
//_outboundQueue = new CoDelPriorityBlockingQueue(ctx, "UDP-PeerState", 32);
_outboundQueue = new PriBlockingQueue(32);
// all createRateStat() moved to EstablishmentManager
_remoteIP = remoteIP;
_remotePeer = remotePeer;
@@ -1397,7 +1400,8 @@ class PeerState {
tempList = new ArrayList(_outboundMessages);
_outboundMessages.clear();
}
_outboundQueue.drainAllTo(tempList);
//_outboundQueue.drainAllTo(tempList);
_outboundQueue.drainTo(tempList);
for (OutboundMessageState oms : tempList) {
_transport.failed(oms, false);
}