increase the (essentially) arbitrary choke on message send times (which has caused some reliability problems under load)

This commit is contained in:
jrandom
2004-08-01 20:37:44 +00:00
committed by zzz
parent 8add433966
commit 94becebafa

View File

@ -432,6 +432,13 @@ class TCPConnection implements I2NPMessageReader.I2NPMessageEventListener {
_log.warn("Error reading from stream to " + _remoteIdentity.getHash().toBase64(), error);
}
/**
* If we are taking an absurdly long time to send out a message, drop it
* since we're overloaded.
*
*/
private static final long MAX_LIFETIME_BEFORE_OUTBOUND_EXPIRE = 15*1000;
class ConnectionRunner implements Runnable {
private boolean _running;
public void run() {
@ -494,7 +501,7 @@ class TCPConnection implements I2NPMessageReader.I2NPMessageEventListener {
long lifetime = cur.timestamp("TCPConnection.runner.locked_expireOldMessages still ok with "
+ (i) + " ahead and " + (_toBeSent.size()-i-1)
+ " behind on the queue");
if (lifetime > 5*1000) {
if (lifetime > MAX_LIFETIME_BEFORE_OUTBOUND_EXPIRE) {
cur.timestamp("TCPConnection.runner.locked_expireOldMessages lifetime too long - " + lifetime);
if (timedOut == null)
timedOut = new ArrayList(2);