Author: toad
Date: 2007-06-13 14:48:02 +0000 (Wed, 13 Jun 2007)
New Revision: 13556
Modified:
trunk/freenet/src/freenet/node/updater/NodeUpdateManager.java
trunk/freenet/src/freenet/node/updater/RevocationChecker.java
Log:
After 5 minutes, deploy the update even if we haven't got 3 DNFs on the
revocation key.
We will get the revocation cert propagated through UOM, and we want UOM to work
on nodes where all their peers are TOO_NEW - that's the whole point!
Modified: trunk/freenet/src/freenet/node/updater/NodeUpdateManager.java
===================================================================
--- trunk/freenet/src/freenet/node/updater/NodeUpdateManager.java
2007-06-13 09:54:37 UTC (rev 13555)
+++ trunk/freenet/src/freenet/node/updater/NodeUpdateManager.java
2007-06-13 14:48:02 UTC (rev 13556)
@@ -325,6 +325,11 @@
private static final int WAIT_FOR_SECOND_FETCH_TO_COMPLETE = 240*1000;
private static final int RECENT_REVOCATION_INTERVAL = 120*1000;
+ /** After 5 minutes, deploy the update even if we haven't got 3 DNFs on
the revocation key yet.
+ * Reason: we want to be able to deploy UOM updates on nodes with all
TOO NEW or leaf nodes
+ * whose peers are overloaded/broken. Note that with UOM, revocation
certs are automatically
+ * propagated node to node, so this should be *relatively* safe. Any
better ideas, tell us. */
+ private static final int REVOCATION_FETCH_TIMEOUT = 5*60*1000;
/** Does the updater have an update ready to deploy? May be called
synchronized(this) */
private boolean isReadyToDeployUpdate(boolean ignoreRevocation) {
@@ -341,8 +346,11 @@
if(!ignoreRevocation) {
if(now - revocationChecker.lastSucceeded() <
RECENT_REVOCATION_INTERVAL)
return true;
+ if(now - revocationChecker.startedFetch >
REVOCATION_FETCH_TIMEOUT)
+ return true;
}
}
+ // Apparently everything is ready except the revocation fetch.
So start it.
revocationChecker.start(true);
if(ignoreRevocation) return true;
deployOffThread(WAIT_FOR_SECOND_FETCH_TO_COMPLETE -
startedMillisAgo);
@@ -567,6 +575,7 @@
}
}
revocationChecker.start(true);
+ deployOffThread(REVOCATION_FETCH_TIMEOUT);
if(!isAutoUpdateAllowed)
broadcastUOMAnnounces();
}
Modified: trunk/freenet/src/freenet/node/updater/RevocationChecker.java
===================================================================
--- trunk/freenet/src/freenet/node/updater/RevocationChecker.java
2007-06-13 09:54:37 UTC (rev 13555)
+++ trunk/freenet/src/freenet/node/updater/RevocationChecker.java
2007-06-13 14:48:02 UTC (rev 13556)
@@ -32,6 +32,8 @@
private FetchContext ctxRevocation;
private ClientGetter revocationGetter;
private boolean wasAggressive;
+ /** Last time we started a fetch, or restarted it aggressively */
+ long startedFetch;
/** Last time at which we got 3 DNFs on the revocation key */
private long lastSucceeded;
@@ -111,6 +113,7 @@
if(cg != null) {
cg.start();
if(logMINOR) Logger.minor(this, "Started
revocation fetcher");
+ startedFetch = System.currentTimeMillis();
}
} catch (FetchException e) {
Logger.error(this, "Not able to start the revocation
fetcher.");