2006-07-28 jrandom

* Don't try to reverify too many netDb entries at once (thanks
      cervantes and Complication!)
This commit is contained in:
jrandom
2006-07-29 04:41:15 +00:00
committed by zzz
parent 9bd0c79441
commit b25bb053bb
4 changed files with 17 additions and 7 deletions

View File

@ -1,4 +1,8 @@
$Id: history.txt,v 1.500 2006-07-27 22:34:59 jrandom Exp $
$Id: history.txt,v 1.501 2006-07-28 20:11:52 jrandom Exp $
2006-07-28 jrandom
* Don't try to reverify too many netDb entries at once (thanks
cervantes and Complication!)
2006-07-28 jrandom
* Actually fix the threading deadlock issue in the netDb (removing

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.439 $ $Date: 2006-07-27 22:35:00 $";
public final static String ID = "$Revision: 1.440 $ $Date: 2006-07-28 20:11:54 $";
public final static String VERSION = "0.6.1.23";
public final static long BUILD = 1;
public final static long BUILD = 2;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -233,6 +233,12 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
}
protected void lookupBeforeDropping(Hash peer, RouterInfo info) {
if (_context.jobQueue().getMaxLag() > 500) {
// don't try to overload ourselves (e.g. failing 3000 router refs at
// once, and then firing off 3000 netDb lookup tasks)
super.lookupBeforeDropping(peer, info);
return;
}
// this sends out the search to the floodfill peers even if we already have the
// entry locally, firing no job if it gets a reply with an updated value (meaning
// we shouldn't drop them but instead use the new data), or if they all time out,

View File

@ -363,16 +363,16 @@ class PersistentDataStore extends TransientDataStore {
}
}
} catch (DataFormatException dfe) {
if (_log.shouldLog(Log.ERROR))
_log.error("Error reading the routerInfo from " + _routerFile.getName(), dfe);
if (_log.shouldLog(Log.INFO))
_log.info("Error reading the routerInfo from " + _routerFile.getName(), dfe);
corrupt = true;
} finally {
if (fis != null) try { fis.close(); } catch (IOException ioe) {}
}
if (corrupt) _routerFile.delete();
} catch (IOException ioe) {
if (_log.shouldLog(Log.ERROR))
_log.error("Unable to read the router reference in " + _routerFile.getName(), ioe);
if (_log.shouldLog(Log.INFO))
_log.info("Unable to read the router reference in " + _routerFile.getName(), ioe);
}
}
}