2009-04-10 sponge

* More BOB threadgroup fixes, plus debug dump when things go wrong.
    * Fixes to streaminglib, I2CP, which are related to the TG problem.
    * JavaDocs fixups.
This commit is contained in:
sponge
2009-04-10 23:12:41 +00:00
parent 2a2d3c0fb5
commit 384d655b1a
18 changed files with 348 additions and 188 deletions

View File

@ -187,12 +187,12 @@ public class Connection {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Outbound window is full (" + _outboundPackets.size() + "/" + _options.getWindowSize() + "/"
+ _activeResends + "), waiting " + timeLeft);
try { _outboundPackets.wait(Math.min(timeLeft,250l)); } catch (InterruptedException ie) {}
try { _outboundPackets.wait(Math.min(timeLeft,250l)); } catch (InterruptedException ie) { if (_log.shouldLog(Log.DEBUG)) _log.debug("InterruptedException while Outbound window is full (" + _outboundPackets.size() + "/" + _activeResends +")"); return false;}
} else {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Outbound window is full (" + _outboundPackets.size() + "/" + _activeResends
+ "), waiting indefinitely");
try { _outboundPackets.wait(250); } catch (InterruptedException ie) {} //10*1000
try { _outboundPackets.wait(250); } catch (InterruptedException ie) {if (_log.shouldLog(Log.DEBUG)) _log.debug("InterruptedException while Outbound window is full (" + _outboundPackets.size() + "/" + _activeResends + ")"); return false;} //10*1000
}
} else {
_context.statManager().addRateData("stream.chokeSizeEnd", _outboundPackets.size(), _context.clock().now() - start);
@ -810,7 +810,11 @@ public class Connection {
synchronized (_connectLock) {
_connectLock.wait(timeLeft);
}
} catch (InterruptedException ie) {}
} catch (InterruptedException ie) {
if (_log.shouldLog(Log.DEBUG)) _log.debug("waitForConnect(): InterruptedException");
_connectionError = "InterruptedException";
return;
}
}
}

View File

@ -126,7 +126,7 @@ class ConnectionHandler {
if (timeoutMs <= 0) {
try {
syn = _synQueue.take(); // waits forever
} catch (InterruptedException ie) {}
} catch (InterruptedException ie) { break;}
} else {
long remaining = expiration - _context.clock().now();
// (dont think this applies anymore for LinkedBlockingQueue)
@ -138,7 +138,7 @@ class ConnectionHandler {
break;
try {
syn = _synQueue.poll(remaining, TimeUnit.MILLISECONDS); // waits the specified time max
} catch (InterruptedException ie) {}
} catch (InterruptedException ie) { }
break;
}
}

View File

@ -213,7 +213,7 @@ public class PacketLocal extends Packet implements MessageOutputStream.WriteStat
timeRemaining = 10*1000;
wait(timeRemaining);
}
} catch (InterruptedException ie) {}
} catch (InterruptedException ie) { break; }
}
if (!writeSuccessful())
releasePayload();