forked from I2P_Developers/i2p.i2p
* Watchdog: Don't dump threads too often (ticket #519)
This commit is contained in:
@ -1,3 +1,6 @@
|
|||||||
|
2012-10-21 zzz
|
||||||
|
* Watchdog: Don't dump threads too often (ticket #519)
|
||||||
|
|
||||||
2012-10-20 zzz
|
2012-10-20 zzz
|
||||||
* Transport: Back out CoDel for SSU PeerState and NTCP
|
* Transport: Back out CoDel for SSU PeerState and NTCP
|
||||||
|
|
||||||
|
@ -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 = 17;
|
public final static long BUILD = 18;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "-rc";
|
public final static String EXTRA = "-rc";
|
||||||
|
@ -23,8 +23,10 @@ public class RouterWatchdog implements Runnable {
|
|||||||
private final RouterContext _context;
|
private final RouterContext _context;
|
||||||
private int _consecutiveErrors;
|
private int _consecutiveErrors;
|
||||||
private volatile boolean _isRunning;
|
private volatile boolean _isRunning;
|
||||||
|
private long _lastDump;
|
||||||
|
|
||||||
private static final long MAX_JOB_RUN_LAG = 60*1000;
|
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) {
|
public RouterWatchdog(RouterContext ctx) {
|
||||||
_context = ctx;
|
_context = ctx;
|
||||||
@ -69,7 +71,7 @@ public class RouterWatchdog implements Runnable {
|
|||||||
|
|
||||||
// Client manager starts complaining after 10 minutes, and we run every minute,
|
// 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.
|
// 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 true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -113,10 +115,14 @@ public class RouterWatchdog implements Runnable {
|
|||||||
// This works on linux...
|
// This works on linux...
|
||||||
// It won't on windows, and we can't call i2prouter.bat either, it does something
|
// It won't on windows, and we can't call i2prouter.bat either, it does something
|
||||||
// completely different...
|
// completely different...
|
||||||
|
long now = _context.clock().now();
|
||||||
|
if (now - _lastDump > MIN_DUMP_INTERVAL) {
|
||||||
|
_lastDump = now;
|
||||||
ThreadDump.dump(_context, 10);
|
ThreadDump.dump(_context, 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
while (_isRunning) {
|
while (_isRunning) {
|
||||||
|
Reference in New Issue
Block a user