Author: robert
Date: 2007-12-19 22:41:02 +0000 (Wed, 19 Dec 2007)
New Revision: 16740

Modified:
   trunk/freenet/src/freenet/node/CHKInsertSender.java
Log:
could this be why inserts are slow?


Modified: trunk/freenet/src/freenet/node/CHKInsertSender.java
===================================================================
--- trunk/freenet/src/freenet/node/CHKInsertSender.java 2007-12-19 22:04:04 UTC 
(rev 16739)
+++ trunk/freenet/src/freenet/node/CHKInsertSender.java 2007-12-19 22:41:02 UTC 
(rev 16740)
@@ -290,7 +290,20 @@
             // Send to next node

             try {
-                               next.sendSync(req, this);
+                               /*
+                                When using sendSync(), this send can often 
timeout (it is the first request we are sending to this node).
+                                -If sendSync blocks here (message queue is 
full, node down, etc.) it can take up to 10 minutes,
+                                 if this occurs at even two nodes in any given 
insert (at any point in the path), the entire insert chain
+                                 will fatally timeout.
+                                -We cannot be informed if sendSync() does 
timeout. A message will be logged, but this thread will simply continue
+                                  to the waitFor() and spend another timeout 
period there.
+                                -The timeout on the waitFor() is 10 seconds 
(ACCEPTED_TIMEOUT).
+                                -The interesting case is when this next node 
is temporarily busy, in which case we might skip a busy node if they
+                                  don't respond in ten seconds 
(ACCEPTED_TIMEOUT). Or, if the length of the send queue to them is greater than
+                                  ACCEPTED_TIMEOUT, using sendAsync() will 
skip them before they get the request. This would be a need for retuning
+                                  ACCEPTED_TIMEOUT.
+                                */
+                               next.sendAsync(req, null, 0, this);
                        } catch (NotConnectedException e1) {
                                if(logMINOR) Logger.minor(this, "Not connected 
to "+next);
                                continue;


Reply via email to