Author: toad
Date: 2008-02-16 13:05:17 +0000 (Sat, 16 Feb 2008)
New Revision: 17987
Modified:
trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
trunk/freenet/src/freenet/client/async/RequestCooldownQueue.java
Log:
Logging, and temporary reduction in cooldown period for debugging
Modified: trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
===================================================================
--- trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
2008-02-16 12:48:04 UTC (rev 17986)
+++ trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
2008-02-16 13:05:17 UTC (rev 17987)
@@ -100,7 +100,7 @@
private final RequestCooldownQueue cooldownQueue;
/** Once a key has been requested a few times, don't request it again
for 30 minutes.
* To do so would be pointless given ULPRs, and just waste bandwidth. */
- public static final long COOLDOWN_PERIOD = 30*60*1000;
+ public static final long COOLDOWN_PERIOD = 2*60*1000;
/** The number of times a key can be requested before triggering the
cooldown period. */
public static final int COOLDOWN_RETRIES = 3;
@@ -678,7 +678,8 @@
public void moveKeysFromCooldownQueue() {
long now = System.currentTimeMillis();
Key key;
- while((key = cooldownQueue.removeKeyBefore(now)) != null) {
+ while((key = cooldownQueue.removeKeyBefore(now)) != null) {
+ if(logMINOR) Logger.minor(this, "Restoring key: "+key);
Object o;
synchronized(pendingKeys) {
o = pendingKeys.get(key);
Modified: trunk/freenet/src/freenet/client/async/RequestCooldownQueue.java
===================================================================
--- trunk/freenet/src/freenet/client/async/RequestCooldownQueue.java
2008-02-16 12:48:04 UTC (rev 17986)
+++ trunk/freenet/src/freenet/client/async/RequestCooldownQueue.java
2008-02-16 13:05:17 UTC (rev 17987)
@@ -157,8 +157,8 @@
if(idx < 0 && startPtr != 0)
idx = Fields.binarySearch(times, time, 0,
endPtr);
}
+ if(logMINOR) Logger.minor(this, "idx = "+idx);
if(idx < 0) return false;
- if(logMINOR) Logger.minor(this, "idx = "+idx);
if(keys[idx] == key) {
keys[idx] = null;
if(logMINOR) Logger.minor(this, "Found (exact)");