Apparently until this revision 16886, (so long as any one node does
not timeout) a node will take as long as necessary to exhaust routable
peers. Even long after the original requestor has given up on that node.
I suspect good and bad from this. On the one hand, all nodes will
become much less busy (increase throughput, decrease latency), but the
data may be not be found at all (as presently the node may continue to
search all its peers and it be cached for next time).
What do you think?
--
Robert Hailey
On Jan 4, 2008, at 12:22 PM, robert at freenetproject.org wrote:
> Author: robert
> Date: 2008-01-04 18:22:10 +0000 (Fri, 04 Jan 2008)
> New Revision: 16886
>
> Modified:
> trunk/freenet/src/freenet/node/RequestSender.java
> Log:
> do not continue a search which has already locally timed out
>
>
> Modified: trunk/freenet/src/freenet/node/RequestSender.java
> ===================================================================
> --- trunk/freenet/src/freenet/node/RequestSender.java 2008-01-04
> 17:22:34 UTC (rev 16885)
> +++ trunk/freenet/src/freenet/node/RequestSender.java 2008-01-04
> 18:22:10 UTC (rev 16886)
> @@ -136,6 +136,7 @@
> pubKey = ((NodeSSK)key).getPubKey();
> }
>
> + long startTime=System.currentTimeMillis();
> HashSet nodesRoutedTo = new HashSet();
> HashSet nodesNotIgnored = new HashSet();
> while(true) {
> @@ -145,6 +146,12 @@
> finish(DATA_NOT_FOUND, null);
> return;
> }
> +
> + if (source!=null && System.currentTimeMillis()-
> startTime>FETCH_TIMEOUT) {
> + Logger.error(this, "discontinuing non-local
> request search,
> general timeout");
> + finish(TIMED_OUT, null);
> + return;
> + }
>
> // Route it
> PeerNode next;
> @@ -586,6 +593,7 @@
> */
> public synchronized short waitUntilStatusChange(short mask) {
> if(mask == WAIT_ALL) throw new IllegalArgumentException("Cannot
> ignore all!");
> + long startTime=System.currentTimeMillis();
> while(true) {
> short current = mask; // If any bits are set already, we
> ignore those states.
>
> @@ -605,6 +613,10 @@
> } catch (InterruptedException e) {
> // Ignore
> }
> + if (source!=null &&
> System.currentTimeMillis()-startTime >
> 2*FETCH_TIMEOUT) {
> + Logger.error(this, "spending way too long
> waiting for request
> sender to finish");
> + throw new RuntimeException("something is
> broken");
> + }
> }
> }
>
>
> _______________________________________________
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
>