diff --git a/history.txt b/history.txt index 6a030bb408..dc55406905 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,8 @@ +2012-09-04 zzz + * I2PTunnelServer: Clean shutdown after session exception + * OutNetMessage: Speedup after profiling (ticket #707 - thx dg, kytv, zab) + * SSU: Fix some issues with queueing outbound establishments + 2012-08-31 zzz * i2psnark: Remove * from magnet and download names * Router: Lengthen shutdown spinner life diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 9319fc01c9..9535f12e9f 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,10 +18,10 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 22; + public final static long BUILD = 23; /** for example "-test" */ - public final static String EXTRA = ""; + public final static String EXTRA = "-rc"; public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA; public static void main(String args[]) { System.out.println("I2P Router version: " + FULL_VERSION); diff --git a/router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java b/router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java index 3470893493..03c7754092 100644 --- a/router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java +++ b/router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java @@ -93,7 +93,7 @@ class EstablishmentManager { private static final int MAX_QUEUED_OUTBOUND = 50; /** max queued msgs per peer while the peer connection is queued */ - private static final int MAX_QUEUED_PER_PEER = 3; + private static final int MAX_QUEUED_PER_PEER = 16; private static final long MAX_NONCE = 0xFFFFFFFFl; @@ -302,15 +302,16 @@ class EstablishmentManager { } if (state == null) { if (queueIfMaxExceeded && _outboundStates.size() >= getMaxConcurrentEstablish()) { - if (_queuedOutbound.size() >= MAX_QUEUED_OUTBOUND) { + if (_queuedOutbound.size() >= MAX_QUEUED_OUTBOUND && !_queuedOutbound.containsKey(to)) { rejected = true; } else { - if (_log.shouldLog(Log.WARN)) - _log.warn("Queueing outbound establish, increase " + PROP_MAX_CONCURRENT_ESTABLISH); List newQueued = new ArrayList(MAX_QUEUED_PER_PEER); List queued = _queuedOutbound.putIfAbsent(to, newQueued); - if (queued == null) + if (queued == null) { queued = newQueued; + if (_log.shouldLog(Log.WARN)) + _log.warn("Queueing outbound establish to " + to + ", increase " + PROP_MAX_CONCURRENT_ESTABLISH); + } // this used to be inside a synchronized (_outboundStates) block, // but that's now a CHM, so protect the ArrayList // There are still races possible but this should prevent AIOOBE and NPE @@ -320,6 +321,8 @@ class EstablishmentManager { queued.add(msg); // increment for the stat below queueCount++; + } else { + rejected = true; } deferred = _queuedOutbound.size(); } @@ -371,7 +374,7 @@ class EstablishmentManager { if (rejected) { if (_log.shouldLog(Log.WARN)) - _log.warn("Rejecting outbound establish"); + _log.warn("Too many pending, rejecting outbound establish to " + to); _transport.failed(msg, "Too many pending outbound connections"); _context.statManager().addRateData("udp.establishRejected", deferred, 0); return;