Changeset 2586db9 for router


Ignore:
Timestamp:
Jul 27, 2018 3:58:14 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
63f0355
Parents:
fc817b0
Message:

Router: Implement router.rejectStartupTime config (ticket #2285)

Location:
router/java/src/net/i2p/router
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/RouterThrottleImpl.java

    rfc817b0 r2586db9  
    2020    private final Log _log;
    2121    private volatile String _tunnelStatus;
     22    private final long _rejectStartupTime;
    2223   
    2324    /**
     
    3435    private static final String PROP_MAX_PROCESSINGTIME = "router.defaultProcessingTimeThrottle";
    3536    private static final long DEFAULT_REJECT_STARTUP_TIME = 10*60*1000;
     37    private static final long MIN_REJECT_STARTUP_TIME = 90*1000;
    3638    private static final String PROP_REJECT_STARTUP_TIME = "router.rejectStartupTime";
    3739    private static final int DEFAULT_MIN_THROTTLE_TUNNELS = SystemVersion.isAndroid() ? 100 :
     
    5456        _log = context.logManager().getLog(RouterThrottleImpl.class);
    5557        setTunnelStatus();
    56         _context.simpleTimer2().addEvent(new ResetStatus(), 5*1000 + _context.getProperty(PROP_REJECT_STARTUP_TIME, DEFAULT_REJECT_STARTUP_TIME));
     58        _rejectStartupTime = Math.max(MIN_REJECT_STARTUP_TIME, _context.getProperty(PROP_REJECT_STARTUP_TIME, DEFAULT_REJECT_STARTUP_TIME));
     59        _context.simpleTimer2().addEvent(new ResetStatus(), 5*1000 + _rejectStartupTime);
    5760        _context.statManager().createRateStat("router.throttleNetworkCause", "How lagged the jobQueue was when an I2NP was throttled", "Throttle", new long[] { 60*1000, 10*60*1000, 60*60*1000, 24*60*60*1000 });
    5861        //_context.statManager().createRateStat("router.throttleNetDbCause", "How lagged the jobQueue was when a networkDb request was throttled", "Throttle", new long[] { 60*1000, 10*60*1000, 60*60*1000, 24*60*60*1000 });
     
    136139       
    137140        // Don't use CRIT because we don't want peers to think we're failing
    138         if (_context.router().getUptime() < DEFAULT_REJECT_STARTUP_TIME) {
     141        if (_context.router().getUptime() < _rejectStartupTime) {
    139142            setTunnelStatus(_x("Rejecting tunnels: Starting up"));
    140143            return TunnelHistory.TUNNEL_REJECT_BANDWIDTH;
  • router/java/src/net/i2p/router/RouterVersion.java

    rfc817b0 r2586db9  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 17;
     21    public final static long BUILD = 18;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.