diff --git a/history.txt b/history.txt index 9f89b5b8e1..1d818997e5 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,6 @@ +2012-10-21 zzz + * Watchdog: Don't dump threads too often (ticket #519) + 2012-10-20 zzz * Transport: Back out CoDel for SSU PeerState and NTCP diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 098e16d499..14408f1ed4 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 17; + public final static long BUILD = 18; /** for example "-test" */ public final static String EXTRA = "-rc"; diff --git a/router/java/src/net/i2p/router/tasks/RouterWatchdog.java b/router/java/src/net/i2p/router/tasks/RouterWatchdog.java index 233c3bd7a0..b37087f1c5 100644 --- a/router/java/src/net/i2p/router/tasks/RouterWatchdog.java +++ b/router/java/src/net/i2p/router/tasks/RouterWatchdog.java @@ -23,8 +23,10 @@ public class RouterWatchdog implements Runnable { private final RouterContext _context; private int _consecutiveErrors; private volatile boolean _isRunning; + private long _lastDump; private static final long MAX_JOB_RUN_LAG = 60*1000; + private static final long MIN_DUMP_INTERVAL= 6*60*60*1000; public RouterWatchdog(RouterContext ctx) { _context = ctx; @@ -69,7 +71,7 @@ public class RouterWatchdog implements Runnable { // Client manager starts complaining after 10 minutes, and we run every minute, // so this will restart 30 minutes after we lose a lease, if the wrapper is present. - if (_consecutiveErrors >= 20 && System.getProperty("wrapper.version") != null) + if (_consecutiveErrors >= 20 && SystemVersion.hasWrapper()) return true; return false; } @@ -113,7 +115,11 @@ public class RouterWatchdog implements Runnable { // This works on linux... // It won't on windows, and we can't call i2prouter.bat either, it does something // completely different... - ThreadDump.dump(_context, 10); + long now = _context.clock().now(); + if (now - _lastDump > MIN_DUMP_INTERVAL) { + _lastDump = now; + ThreadDump.dump(_context, 10); + } } } }