Router: Don't reset uptime after a soft restart

Tunnels: Temporarily increase exploratory tunnel quantity at startup,
so that netdb refresh will work better
This commit is contained in:
zzz
2015-01-07 20:11:04 +00:00
parent a02a265802
commit 0a938d9048
2 changed files with 7 additions and 1 deletions

View File

@ -1273,7 +1273,8 @@ public class Router implements RouterClock.ClockShiftListener {
changeState(State.RESTARTING);
}
((RouterClock) _context.clock()).removeShiftListener(this);
_started = _context.clock().now();
// Let's not stop accepting tunnels, etc
//_started = _context.clock().now();
Thread t = new Thread(new Restarter(_context), "Router Restart");
t.setPriority(Thread.NORM_PRIORITY + 1);
t.start();

View File

@ -52,6 +52,7 @@ public class TunnelPool {
/** if less than one success in this many, reduce length (exploratory only) */
private static final int BUILD_TRIES_LENGTH_OVERRIDE_1 = 10;
private static final int BUILD_TRIES_LENGTH_OVERRIDE_2 = 18;
private static final long STARTUP_TIME = 30*60*1000;
TunnelPool(RouterContext ctx, TunnelPoolManager mgr, TunnelPoolSettings settings, TunnelPeerSelector sel) {
_context = ctx;
@ -348,6 +349,10 @@ public class TunnelPool {
}
}
}
if (_settings.isExploratory() && _context.router().getUptime() < STARTUP_TIME) {
// more exploratory during startup, when we are refreshing the netdb RIs
rv++;
}
return rv;
}