I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit f46a9022 authored by dg2-new's avatar dg2-new
Browse files

Router: Fix soft restarts for 'massive' clock jumps (over +150s or -61s) and...

Router: Fix soft restarts for 'massive' clock jumps (over +150s or -61s) and recover from standby/hibernate (ticket #1014).
I2P should now recover (better) from a system hibernate/standby and be able to reconnect to peers automatically.
parent 39b810bd
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
* Tunnels: Use max of 2 not-failing peers in an exploratory tunnel, * Tunnels: Use max of 2 not-failing peers in an exploratory tunnel,
use high cap for the rest; change outbound exploratory use high cap for the rest; change outbound exploratory
default length from 2 + 0-1 to 3+0. default length from 2 + 0-1 to 3+0.
* Router: Fix soft restarts for 'massive' clock jumps (over +150s or -61s) and recover from standby
and hibernate (ticket #1014).
   
2015-09-25 dg 2015-09-25 dg
* Rename _() for translation to _t() for Java 9 compatibility (ticket #1456) * Rename _() for translation to _t() for Java 9 compatibility (ticket #1456)
......
...@@ -1443,8 +1443,10 @@ public class Router implements RouterClock.ClockShiftListener { ...@@ -1443,8 +1443,10 @@ public class Router implements RouterClock.ClockShiftListener {
_eventLog.addEvent(EventLog.CLOCK_SHIFT, Long.toString(delta)); _eventLog.addEvent(EventLog.CLOCK_SHIFT, Long.toString(delta));
// update the routing key modifier // update the routing key modifier
_context.routerKeyGenerator().generateDateBasedModData(); _context.routerKeyGenerator().generateDateBasedModData();
if (_context.commSystem().countActivePeers() <= 0) // Commented because this check makes no sense (#1014)
return; // .. and 'active' is relative to our broken time.
//if (_context.commSystem().countActivePeers() <= 0)
// return;
if (delta > 0) if (delta > 0)
_log.error("Restarting after large clock shift forward by " + DataHelper.formatDuration(delta)); _log.error("Restarting after large clock shift forward by " + DataHelper.formatDuration(delta));
else else
......
...@@ -18,7 +18,7 @@ public class RouterVersion { ...@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 10; public final static long BUILD = 11;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";
......
...@@ -30,9 +30,9 @@ public class Restarter implements Runnable { ...@@ -30,9 +30,9 @@ public class Restarter implements Runnable {
log.logAlways(Log.WARN, "Stopping the tunnel manager"); log.logAlways(Log.WARN, "Stopping the tunnel manager");
try { _context.tunnelManager().restart(); } catch (Throwable t) { log.log(Log.CRIT, "Error restarting the tunnel manager", t); } try { _context.tunnelManager().restart(); } catch (Throwable t) { log.log(Log.CRIT, "Error restarting the tunnel manager", t); }
//try { _context.peerManager().restart(); } catch (Throwable t) { log.log(Log.CRIT, "Error restarting the peer manager", t); } try { _context.peerManager().restart(); } catch (Throwable t) { log.log(Log.CRIT, "Error restarting the peer manager", t); }
//try { _context.netDb().restart(); } catch (Throwable t) { log.log(Log.CRIT, "Error restarting the networkDb", t); } //try { _context.netDb().restart(); } catch (Throwable t) { log.log(Log.CRIT, "Error restarting the networkDb", t); }
//try { _context.jobQueue().restart(); } catch (Throwable t) { log.log(Log.CRIT, "Error restarting the job queue", t); } try { _context.jobQueue().restart(); } catch (Throwable t) { log.log(Log.CRIT, "Error restarting the job queue", t); }
log.logAlways(Log.WARN, "Router teardown complete, restarting the router..."); log.logAlways(Log.WARN, "Router teardown complete, restarting the router...");
try { Thread.sleep(10*1000); } catch (InterruptedException ie) {} try { Thread.sleep(10*1000); } catch (InterruptedException ie) {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment