Author: toad
Date: 2009-02-12 14:35:21 +0000 (Thu, 12 Feb 2009)
New Revision: 25597

Modified:
   branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
Log:
Don't re-add if already there


Modified: 
branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java  
2009-02-12 14:26:20 UTC (rev 25596)
+++ branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java  
2009-02-12 14:35:21 UTC (rev 25597)
@@ -741,6 +741,14 @@
                        int size = 0;
                        PersistentChosenRequest prev = null;
                        for(PersistentChosenRequest old : starterQueue) {
+                               if(old.request == req) {
+                                       // Wait for a reselect. Otherwise we 
can starve other
+                                       // requests. Note that this happens 
with persistent SBI's:
+                                       // they are added at the new retry 
count before being
+                                       // removed at the old retry count.
+                                       if(logMINOR) Logger.minor(this, 
"Already on starter queue: "+old+" for "+req);
+                                       return;
+                               }
                                if(prev == old)
                                        Logger.error(this, "ON STARTER QUEUE 
TWICE: "+prev+" for "+prev.request);
                                if(prev != null && prev.request == old.request)

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to