propagate from branch 'i2p.i2p.zzz.test' (head 48448fc896d1e0859f481e98d0e80e764cc40736)

to branch 'i2p.i2p' (head aedb9b8335d6de72dd633e79716fff6ffec263a1)
This commit is contained in:
zzz
2012-10-28 12:17:38 +00:00
36 changed files with 11992 additions and 3388 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 = 15;
public final static long BUILD = 0;
/** for example "-test" */
public final static String EXTRA = "";

View File

@ -66,9 +66,9 @@ public class Reseeder {
"http://euve5653.vserver.de/netDb/" + "," +
// "http://r31453.ovh.net/static_media/files/netDb/" + "," +
"http://cowpuncher.drollette.com/netdb/" + "," +
"http://75.145.125.59/netDb/" + "," +
"http://i2p.mooo.com/netDb/" + "," +
"http://193.150.121.66/netDb/";
"http://193.150.121.66/netDb/" + "," +
"http://netdb.i2p2.no/";
/** @since 0.8.2 */
public static final String DEFAULT_SSL_SEED_URL =
@ -78,9 +78,9 @@ public class Reseeder {
"https://reseed.i2p-projekt.de/" + "," +
// "https://r31453.ovh.net/static_media/files/netDb/" + "," +
"https://cowpuncher.drollette.com/netdb/" + "," +
"https://75.145.125.59/netDb/" + "," +
"https://i2p.mooo.com/netDb/" + "," +
"https://193.150.121.66/netDb/";
"https://193.150.121.66/netDb/" + "," +
"https://netdb.i2p2.no/";
public static final String PROP_PROXY_HOST = "router.reseedProxyHost";
public static final String PROP_PROXY_PORT = "router.reseedProxyPort";

View File

@ -24,8 +24,10 @@ public class RouterWatchdog implements Runnable {
private final RouterContext _context;
private int _consecutiveErrors;
private volatile boolean _isRunning;
private long _lastDump;
private static final long MAX_JOB_RUN_LAG = 60*1000;
private static final long MIN_DUMP_INTERVAL= 6*60*60*1000;
public RouterWatchdog(RouterContext ctx) {
_context = ctx;
@ -70,7 +72,7 @@ public class RouterWatchdog implements Runnable {
// Client manager starts complaining after 10 minutes, and we run every minute,
// so this will restart 30 minutes after we lose a lease, if the wrapper is present.
if (_consecutiveErrors >= 20 && System.getProperty("wrapper.version") != null)
if (_consecutiveErrors >= 20 && SystemVersion.hasWrapper())
return true;
return false;
}
@ -114,7 +116,11 @@ public class RouterWatchdog implements Runnable {
// This works on linux...
// It won't on windows, and we can't call i2prouter.bat either, it does something
// completely different...
ThreadDump.dump(_context, 10);
long now = _context.clock().now();
if (now - _lastDump > MIN_DUMP_INTERVAL) {
_lastDump = now;
ThreadDump.dump(_context, 10);
}
}
}
}

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;
@ -89,7 +90,8 @@ class NTCPConnection {
/**
* 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???
@ -159,7 +161,8 @@ class NTCPConnection {
_writeBufs = new ConcurrentLinkedQueue();
_bwInRequests = new ConcurrentHashSet(2);
_bwOutRequests = new ConcurrentHashSet(8);
_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();
@ -186,7 +189,8 @@ class NTCPConnection {
_writeBufs = new ConcurrentLinkedQueue();
_bwInRequests = new ConcurrentHashSet(2);
_bwOutRequests = 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();
@ -310,7 +314,8 @@ class NTCPConnection {
}
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);
}

View File

@ -734,7 +734,13 @@ class PeerTestManager {
return;
}
UDPAddress addr = new UDPAddress(raddr);
SessionKey charlieIntroKey = new SessionKey(addr.getIntroKey());
byte[] ikey = addr.getIntroKey();
if (ikey == null) {
if (_log.shouldLog(Log.WARN))
_log.warn("Unable to pick a charlie");
return;
}
SessionKey charlieIntroKey = new SessionKey(ikey);
//UDPPacket packet = _packetBuilder.buildPeerTestToAlice(aliceIP, from.getPort(), aliceIntroKey, charlieIntroKey, nonce);
//_transport.send(packet);

View File

@ -181,12 +181,13 @@ class BuildHandler implements Runnable {
return;
}
long dropBefore = System.currentTimeMillis() - (BuildRequestor.REQUEST_TIMEOUT/4);
long now = _context.clock().now();
long dropBefore = now - (BuildRequestor.REQUEST_TIMEOUT/4);
if (state.recvTime <= dropBefore) {
if (_log.shouldLog(Log.WARN))
_log.warn("Not even trying to handle/decrypt the request " + state.msg.getUniqueId()
+ ", since we received it a long time ago: " + (System.currentTimeMillis() - state.recvTime));
_context.statManager().addRateData("tunnel.dropLoadDelay", System.currentTimeMillis() - state.recvTime, 0);
+ ", since we received it a long time ago: " + (now - state.recvTime));
_context.statManager().addRateData("tunnel.dropLoadDelay", now - state.recvTime, 0);
_context.throttle().setTunnelStatus(_x("Dropping tunnel requests: Too slow"));
return;
}
@ -324,7 +325,7 @@ class BuildHandler implements Runnable {
/** @return handle time or -1 if it wasn't completely handled */
private long handleRequest(BuildMessageState state) {
long timeSinceReceived = System.currentTimeMillis()-state.recvTime;
long timeSinceReceived = _context.clock().now()-state.recvTime;
if (_log.shouldLog(Log.DEBUG))
_log.debug(state.msg.getUniqueId() + ": handling request after " + timeSinceReceived);
@ -533,7 +534,7 @@ class BuildHandler implements Runnable {
// response = TunnelHistory.TUNNEL_REJECT_PROBABALISTIC_REJECT;
int proactiveDrops = countProactiveDrops();
long recvDelay = System.currentTimeMillis()-state.recvTime;
long recvDelay = _context.clock().now()-state.recvTime;
if (response == 0) {
float pDrop = ((float) recvDelay) / (float) (BuildRequestor.REQUEST_TIMEOUT*3);
pDrop = (float)Math.pow(pDrop, 16);
@ -771,7 +772,7 @@ class BuildHandler implements Runnable {
BuildMessageState cur = _inboundBuildMessages.peek();
boolean accept = true;
if (cur != null) {
long age = System.currentTimeMillis() - cur.recvTime;
long age = _context.clock().now() - cur.recvTime;
if (age >= BuildRequestor.REQUEST_TIMEOUT/4) {
_context.statManager().addRateData("tunnel.dropLoad", age, sz);
_context.throttle().setTunnelStatus(_x("Dropping tunnel requests: High load"));