[freenet-dev] Request Coalescing deadlocks - r17164

Robert Hailey freenet-devl at osndok.com
Sat Jan 19 05:51:02 UTC 2008


Requests equi-distant from each other can create dead-lock loops  
because the uid changes. Without disabling request coalescing  
altogether I could not think of a better solution, but this solves 90%  
of the problem.

There is another deadlock condition regarding probablisticHtl  
decrementing which is much less likely (requires at least a 5-node  
race condition) as follows:

         B
   A   C
     D
       E

C, D, & E each respectively probabilistically don't decrement

(1) Node A (2/11) & B(2/22) both start/route a request (htl/uid)
(2) D routes to E (1/11)
(3) C routes to D (1/22), where the request is coalesced with (1/11)
(4) E routes to C where the request is coalesced with (1/22).

Without this patch even if it were only two nodes starting (for  
example, a USK fetch) at the same time, they would each ask the other  
and each request would be coalesced onto the other.

--
Robert Hailey

On Jan 18, 2008, at 11:02 PM, robert at freenetproject.org wrote:

> Author: robert
> Date: 2008-01-19 05:02:58 +0000 (Sat, 19 Jan 2008)
> New Revision: 17164
>
> Modified:
>   trunk/freenet/src/freenet/node/Node.java
>   trunk/freenet/src/freenet/node/RequestSender.java
> Log:
> fix fatal timeout
>
>
> Modified: trunk/freenet/src/freenet/node/Node.java
> ===================================================================
> --- trunk/freenet/src/freenet/node/Node.java	2008-01-19 03:33:18 UTC  
> (rev 17163)
> +++ trunk/freenet/src/freenet/node/Node.java	2008-01-19 05:02:58 UTC  
> (rev 17164)
> @@ -1779,7 +1779,7 @@
> 			// Request coalescing
> 			KeyHTLPair kh = new KeyHTLPair(key, htl);
> 			sender = (RequestSender) requestSenders.get(kh);
> -			if(sender != null) {
> +			if(sender != null && !sender.isLocalRequestSearch()) {
> 				if(logMINOR) Logger.minor(this, "Found sender: "+sender+" for  
> "+uid);
> 				return sender;
> 			}
>
> Modified: trunk/freenet/src/freenet/node/RequestSender.java
> ===================================================================
> --- trunk/freenet/src/freenet/node/RequestSender.java	2008-01-19  
> 03:33:18 UTC (rev 17163)
> +++ trunk/freenet/src/freenet/node/RequestSender.java	2008-01-19  
> 05:02:58 UTC (rev 17164)
> @@ -851,4 +851,8 @@
> 	synchronized int getRecentlyFailedTimeLeft() {
> 		return recentlyFailedTimeLeft;
> 	}
> +	
> +	public boolean isLocalRequestSearch() {
> +		return (source==null);
> +	}
> }
>
> _______________________________________________
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://emu.freenetproject.org/pipermail/devl/attachments/20080118/96c36262/attachment.htm 


More information about the Devl mailing list