Author: toad
Date: 2008-03-19 20:41:59 +0000 (Wed, 19 Mar 2008)
New Revision: 18626

Modified:
   trunk/freenet/src/freenet/node/RequestSender.java
Log:
Can't timeout here, because if we timeout before RequestSender has actually 
finished, we will prematurely unlock the UID!

Modified: trunk/freenet/src/freenet/node/RequestSender.java
===================================================================
--- trunk/freenet/src/freenet/node/RequestSender.java   2008-03-19 19:34:44 UTC 
(rev 18625)
+++ trunk/freenet/src/freenet/node/RequestSender.java   2008-03-19 20:41:59 UTC 
(rev 18626)
@@ -1013,6 +1013,7 @@
      */
     public synchronized short waitUntilStatusChange(short mask) {
        if(mask == WAIT_ALL) throw new IllegalArgumentException("Cannot ignore 
all!");
+       while(true) {
        long deadline = System.currentTimeMillis() + 300*1000;
         while(true) {
                short current = mask; // If any bits are set already, we ignore 
those states.
@@ -1030,12 +1031,15 @@

             try {
                long now = System.currentTimeMillis();
-               if(now >= deadline) throw new IllegalStateException("Waited 
more than 5 minutes");
+               if(now >= deadline) {
+                       Logger.error(this, "Waited more than 5 minutes for 
status change on "+this+" current = "+current);
+               }
                 wait(deadline - now);
             } catch (InterruptedException e) {
                 // Ignore
             }
         }
+       }
     }

     /**


Reply via email to