mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-24 02:03:01 +00:00
Router: Fix PublishRouterInfoJob sometimes not getting started
if setNetDbReady() is called when netDb().isInitialized() is false. This can happen if the router has a few RIs at at startup but not enough and it reseeds, or if reseed is very slow? If PLRIJ does not run then the local RI doesn't get updated and most connections fail due to RI clock skew in the handshake. Then the router is essentially stuck.
This commit is contained in:
1 file changed
+6
-6
@@ -787,7 +787,7 @@ public class Router implements RouterClock.ClockShiftListener {
|
||||
synchronized(_configFileLock) {
|
||||
String f = getConfigFilename();
|
||||
Properties config = getConfig(_context, f);
|
||||
// to avoid compiler errror
|
||||
// to avoid compiler error
|
||||
Map foo = _config;
|
||||
foo.putAll(config);
|
||||
}
|
||||
@@ -956,23 +956,23 @@ public class Router implements RouterClock.ClockShiftListener {
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (changed && _context.netDb().isInitialized()) {
|
||||
if (changed) {
|
||||
if (_log.shouldWarn())
|
||||
_log.warn("NetDB ready, publishing RI");
|
||||
_log.warn("NetDB ready, initialized? " + _context.netDb().isInitialized());
|
||||
// any previous calls to netdb().publish() did not
|
||||
// actually publish, because netdb init was not complete
|
||||
Republish r = new Republish(_context);
|
||||
// this is called from PersistentDataStore.ReadJob,
|
||||
// so we probably don't need to throw it to the timer queue,
|
||||
// but just to be safe
|
||||
_context.simpleTimer2().addEvent(r, 0);
|
||||
long delay = _context.netDb().isInitialized() ? 0 : 60*1000;
|
||||
_context.simpleTimer2().addEvent(r, delay);
|
||||
|
||||
// periodically update our RI and republish it to the flooodfills
|
||||
PublishLocalRouterInfoJob plrij = new PublishLocalRouterInfoJob(_context);
|
||||
plrij.getTiming().setStartAfter(_context.clock().now() + plrij.getDelay());
|
||||
_context.jobQueue().addJob(plrij);
|
||||
}
|
||||
if (changed) {
|
||||
|
||||
_context.commSystem().initGeoIP();
|
||||
|
||||
if (!SystemVersion.isSlow() &&
|
||||
|
||||
Reference in new issue
Block a user