Update of /cvsroot/freenet/freenet/src/freenet/node
In directory sc8-pr-cvs1:/tmp/cvs-serv15810/src/freenet/node

Modified Files:
        ConnectionOpener.java Main.java Node.java 
Log Message:
6249:
Iakin's fix for Request.java - nasty bug, may have caused requests from recent nodes 
to fail.
Try to fix lock contention in RandomAccessFilePool. Code review would be appreciated. 
Catch Throwables when closing files.
Reduce outLimitCutoff to 80%. Thus the node will reject all queries if it is using 
more than 80% of outbound bandwidth. The previous 90% figure conflicted with the hard 
bandwidth limit of 120%, which (because it is deliberately conservative), was 
preventing it from going over 90%.
Implement removal of PeerHandlers from OCM, when either
a) No connections and no contact details, and not in routing table, regardless of 
whether we have queued messages or
b) No connections, no messages.
- Some tricky concurrency issues, hence the new RemovingPeerHandlerException
Track number and last event time for outbound connection attempts, successes, and 
failures, in PeerHandler.
Add PeerHandler.probablyNotConnectable()
Don't queue messages if we are unlikely to be able to open a connection and we have no 
current connections
Diagnostics - messageSendTime* especially. Added messageSendTime{Request,NonRequest}, 
fixed messageSendTimeNoQR.
Make sending a QR because of a loop in RequestDone asynchronous.
Don't add PeerHandlers with null IDs in OCM (probably not used).
Lots of logging, a few toString()'s, indenting
- remove some spurious logging, for example, Accepted before SendFinished is okay 
unless it's a lot before it, or the SendFinished is unsuccessful


Index: ConnectionOpener.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/ConnectionOpener.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -w -r1.20 -r1.21
--- ConnectionOpener.java       11 Oct 2003 23:06:38 -0000      1.20
+++ ConnectionOpener.java       15 Oct 2003 21:15:48 -0000      1.21
@@ -7,6 +7,7 @@
 import freenet.node.states.maintenance.Checkpoint;
 import freenet.CommunicationException;
 import freenet.support.Checkpointed;
+import freenet.PeerHandler;
 import freenet.Core;
 import freenet.support.Logger;
 import java.util.Hashtable;
@@ -160,6 +161,14 @@
            backoff();
            return;
        }
+       PeerHandler ph = ocm.makePeerHandler(id, null);
+       if(ph == null) {
+           Core.logger.log(this, "ocm returned null for peerhandler for "+
+                           id, Logger.ERROR);
+           return;
+       } else {
+           ph.attemptingOutboundConnection();
+       }
        long startTime = System.currentTimeMillis();
        try {
            if(logMINOR)
@@ -171,6 +180,7 @@
            // -1 means run blocking
            
            long diff = System.currentTimeMillis() - startTime;
+           ph.succeededOutboundConnection();
            if(!ch.isCached()) rt.reportConnectionSuccess(id, diff);
            // FIXME: possible race on isCached?
            if(logMINOR)
@@ -182,6 +192,7 @@
        } catch (CommunicationException e) {
            Core.logger.log(this, "Could not establish connection to "+ref+
                            ": "+e+" ("+this+")", e, Logger.MINOR);
+           if(ph != null) ph.failedOutboundConnection();
            if(startTime > 0)
                rt.reportConnectionFailure(id, System.currentTimeMillis() -
                                           startTime);

Index: Main.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/Main.java,v
retrieving revision 1.266
retrieving revision 1.267
diff -u -w -r1.266 -r1.267
--- Main.java   13 Oct 2003 15:42:01 -0000      1.266
+++ Main.java   15 Oct 2003 21:15:48 -0000      1.267
@@ -1973,6 +1973,13 @@
                                                         "The total time taken to send 
a message to a "+
                                                         "node we don't have contact 
details for",
                                                         messages);
+               d.registerContinuous("messageSendTimeRequest", d.MINUTE,
+                                                        "The total time taken to send 
a DataRequest or "+
+                                                        "InsertRequest message to a 
node in the routing "+
+                                                        "table", messages);
+               d.registerContinuous("messageSendTimeNonRequest", d.MINUTE,
+                                                        "The total time taken to send 
a message other "+
+                                                        "than a DataRequest or 
InsertRequest", messages);
                d.registerContinuous("messageSendTimeRT", d.MINUTE,
                                                         "The total time taken to send 
a message to a node in the routing table", messages);
                d.registerContinuous("messageSendTimeNonRT", d.MINUTE,

Index: Node.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/Node.java,v
retrieving revision 1.219
retrieving revision 1.220
diff -u -w -r1.219 -r1.220
--- Node.java   15 Oct 2003 11:34:50 -0000      1.219
+++ Node.java   15 Oct 2003 21:15:48 -0000      1.220
@@ -211,7 +211,7 @@
                config.addOption("requestDelayCutoff",1,1000,3254);
                config.addOption("successfulDelayCutoff",1,2000,3255);
                config.addOption("doOutLimitCutoff",1,true,3256);
-               config.addOption("outLimitCutoff",1,0.9F,3257);
+               config.addOption("outLimitCutoff",1,0.8F,3257);
                config.addOption("doOutLimitConnectCutoff",1,true,3258);
                config.addOption("outLimitConnectCutoff",1,2.0F,3259);
                config.addOption("lowLevelBWLimitFudgeFactor",1,3F/4F,3260);

_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to