Update of /cvsroot/freenet/freenet/src/freenet/node/rt
In directory sc8-pr-cvs1:/tmp/cvs-serv27784/src/freenet/node/rt
Modified Files:
DecayingRunningAverage.java Estimate.java NGRouting.java
NGRoutingTable.java StandardNodeEstimator.java
Log Message:
6280:
WE WERE ROUTING TO THE NODE WITH THE WORST ESTIMATE. PROFUSE APOLOGIES, MAYBE IT WILL
WORK BETTER NOW!!!
Don't count nodes we aren't connected to for purposes of pLegitDNF
Logging, try to catch hirvox crash-bug.
Index: DecayingRunningAverage.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/DecayingRunningAverage.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -r1.4 -r1.5
--- DecayingRunningAverage.java 17 Oct 2003 01:43:29 -0000 1.4
+++ DecayingRunningAverage.java 25 Oct 2003 18:28:00 -0000 1.5
@@ -2,6 +2,7 @@
import freenet.support.DataObject;
import freenet.Core;
+import freenet.support.Logger;
import java.io.IOException;
import java.io.DataOutputStream;
import java.io.DataInputStream;
@@ -32,6 +33,9 @@
}
public synchronized final void report(double d) {
+ if(d < 0 || d > (3600*1000))
+ Core.logger.log(this, "Implausible report: "+d,
+ new Exception("debug"), Logger.ERROR);
currentVal = currentVal * (1-decayFactor) +
d * decayFactor;
}
Index: Estimate.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/Estimate.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- Estimate.java 30 Aug 2003 23:16:52 -0000 1.2
+++ Estimate.java 25 Oct 2003 18:28:00 -0000 1.3
@@ -11,8 +11,8 @@
public int compareTo(Object o) {
Estimate e = (Estimate)o;
- if(value < e.value) return 1;
- if(value > e.value) return -1;
+ if(value > e.value) return 1;
+ if(value < e.value) return -1;
else return 0;
}
Index: NGRouting.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/NGRouting.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -r1.9 -r1.10
--- NGRouting.java 4 Oct 2003 22:29:34 -0000 1.9
+++ NGRouting.java 25 Oct 2003 18:28:00 -0000 1.10
@@ -59,7 +59,8 @@
}
last = list[at].ne;
Core.logger.log(this, toString()+".getNextRoute() iteration "+
- count+" got "+last, Logger.DEBUG);
+ count+" got "+last+" (estimate "+list[at].value+")",
+ Logger.DEBUG);
at++;
count++;
lastTime = System.currentTimeMillis();
@@ -158,7 +159,9 @@
public void transferFailed(long time, int htl, long size,
long transferTime) {
- last.transferFailed(key, System.currentTimeMillis() - lastTime, size);
+ long now = System.currentTimeMillis();
+ last.transferFailed(key, now - lastTime, size);
+ lastTime = now;
// transferFailed is usually not terminal
}
Index: NGRoutingTable.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/NGRoutingTable.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -w -r1.17 -r1.18
--- NGRoutingTable.java 25 Oct 2003 00:45:36 -0000 1.17
+++ NGRoutingTable.java 25 Oct 2003 18:28:00 -0000 1.18
@@ -97,8 +97,9 @@
NodeReference ref = mem.getNodeReference();
if(!Version.checkGoodVersion(ref.getVersion(),
true)) {
Core.logger.log(this, "Rejecting
reference "+ref+
- " -
too old in loadEstimators",
-
Logger.NORMAL);
+ " -
too old ("+ref.getVersion()+
+ ") in
loadEstimators",
+ new
Exception("debug"), Logger.NORMAL);
continue;
}
ne = factory.create(mem, ref, e, false);
@@ -167,8 +168,9 @@
Logger.DEBUG);
if(mem == null) {
if(!Version.checkGoodVersion(nr.getVersion(), true)) {
- Core.logger.log(this, "Rejecting reference "+nr+" -
too old",
- Logger.NORMAL);
+ Core.logger.log(this, "Rejecting reference "+nr+" -
too old ("+
+ nr.getVersion()+") in
reference()",
+ new
Exception("debug"), Logger.NORMAL);
return;
}
if(!nr.isSigned()) {
@@ -244,10 +246,17 @@
double d = ne.dnfProbability();
if(ne.successes() >= 1) {
semiWild++;
- if(pSemiLegitDNF > d) pSemiLegitDNF = d;
+ if(pSemiLegitDNF > d) {
+ Core.logger.log(this, "New entry for
pSemiLegitDNF "+ne+
+ " at
"+d, Logger.MINOR);
+ pSemiLegitDNF = d;
+ }
}
if(ne.successes() > 5) {
nonWild++;
+
if(node.connections.countConnections(ne.ref.getIdentity()) > 0)
+ Core.logger.log(this, "New entry for
pLegitDNF "+ne+" at "+
+ d,
Logger.MINOR);
if(pLegitDNF > d) pLegitDNF = d;
}
// FIXME!
Index: StandardNodeEstimator.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/StandardNodeEstimator.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -r1.9 -r1.10
--- StandardNodeEstimator.java 22 Oct 2003 22:07:16 -0000 1.9
+++ StandardNodeEstimator.java 25 Oct 2003 18:28:01 -0000 1.10
@@ -171,18 +171,22 @@
return Long.MAX_VALUE;
}
double tSuccess =
- etSuccessSearch.guessTime(k) + ((double)size) /
- etTransferRate.guessTransferRate(k);
+ etSuccessSearch.guessTime(k) +
+ (((double)size) / etTransferRate.guessTransferRate(k));
estimate += pSuccess * tSuccess;
-/* Core.logger.log(this, "rFT "+requestFailTime
- +" "+needConnection+" "+pConnectFailed+" "+tConnectFailed
- +" "+pSearchFailed+" "+tSearchFailed
- +" "+pTransferFailed+" "+tTransferFailed
- +" "+pDNF+" "+tDNF+" "+pLegitDNF
- +" "+tSuccess+" "+estimate,
- Logger.NORMAL);
-*/
+ if(Core.logger.shouldLog(Logger.MINOR, this))
+ Core.logger.log(this, toString()+".estimate():
rFT="+requestFailTime
+ +",
needConn="+needConnection+", size="+size+", key="+
+ k+", htl="+htl+",
pConnectFailed="+pConnectFailed
+ +",
tConnectFailed="+tConnectFailed
+ +",
pSearchFailed="+pSearchFailed+", tSearchFailed="+
+ tSearchFailed+",
pTransferFailed="+pTransferFailed+
+ ",
tTransferFailed="+tTransferFailed+", pDNF="+pDNF+
+ ", tDNF="+tDNF+",
pLegitDNF="+pLegitDNF
+ +", tSuccess="+tSuccess+",
estimate="+estimate+"ms",
+ Logger.MINOR);
+
return (long)estimate;
}
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs