less aggressive removal of peer references

logging
This commit is contained in:
jrandom
2004-07-29 20:36:44 +00:00
committed by zzz
parent 3b9fea20b6
commit 25378e894b
3 changed files with 8 additions and 6 deletions

View File

@ -59,7 +59,7 @@ public class Shitlist {
wasAlready = (null == oldDate); wasAlready = (null == oldDate);
} }
_context.netDb().fail(peer); //_context.netDb().fail(peer);
_context.tunnelManager().peerFailed(peer); _context.tunnelManager().peerFailed(peer);
return wasAlready; return wasAlready;
} }

View File

@ -32,7 +32,7 @@ class ExpireRoutersJob extends JobImpl {
private Log _log; private Log _log;
private KademliaNetworkDatabaseFacade _facade; private KademliaNetworkDatabaseFacade _facade;
private final static long RERUN_DELAY_MS = 30*1000; private final static long RERUN_DELAY_MS = 120*1000;
/** /**
* If a routerInfo structure isn't updated within an hour, drop it * If a routerInfo structure isn't updated within an hour, drop it
* and search for a later version. This value should be large enough * and search for a later version. This value should be large enough

View File

@ -506,11 +506,13 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
if (isRouterInfo) { if (isRouterInfo) {
int remaining = _kb.size(); int remaining = _kb.size();
if (remaining < MIN_REMAINING_ROUTERS) { if (remaining < MIN_REMAINING_ROUTERS) {
_log.warn("Not removing " + dbEntry + " because we have so few routers left (" if (_log.shouldLog(Log.ERROR))
_log.error("Not removing " + dbEntry + " because we have so few routers left ("
+ remaining + ") - perhaps a reseed is necessary?"); + remaining + ") - perhaps a reseed is necessary?");
return; return;
} }
if (System.currentTimeMillis() < _started + DONT_FAIL_PERIOD) { if (System.currentTimeMillis() < _started + DONT_FAIL_PERIOD) {
if (_log.shouldLog(Log.WARN))
_log.warn("Not failing the key " + dbEntry.toBase64() _log.warn("Not failing the key " + dbEntry.toBase64()
+ " since we've just started up and don't want to drop /everyone/"); + " since we've just started up and don't want to drop /everyone/");
return; return;