Changeset 37f34d8


Ignore:
Timestamp:
Jan 7, 2015 5:54:21 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
bcb9fe5
Parents:
b3238079
Message:

Router: Add startup/shutdown state machine
Tunnels: Cleanup, catch more cases of zero-hop configuration
ClientAppConfig?: Start i2ptunnel sooner

Since BuildRequestor? won't use a zero-hop exploratory as a paired tunnel
for client builds, it's now safe to start client tunnels
before the expl. tunnels are ready. This will save up to 90 seconds.

Files:
12 edited

Legend:

Unmodified
Added
Removed
  • history.txt

    rb3238079 r37f34d8  
     12015-01-07 zzz
     2 * ClientAppConfig: Start i2ptunnel sooner
     3 * Router: Add startup/shutdown state machine
     4 * Tunnels: Cleanup, catch more cases of zero-hop configuration
     5
    162015-01-05 zzz
    27 * Blocklist:
  • installer/resources/clients.config

    rb3238079 r37f34d8  
    4040clientApp.2.name=Application tunnels
    4141clientApp.2.args=i2ptunnel.config
     42clientApp.2.delay=35
    4243clientApp.2.startOnLoad=true
    4344
  • router/java/src/net/i2p/router/Router.java

    rb3238079 r37f34d8  
    7979    //private SessionKeyPersistenceHelper _sessionKeyPersistenceHelper;
    8080    private boolean _killVMOnEnd;
    81     private volatile boolean _isAlive;
    8281    private int _gracefulExitCode;
    8382    private I2PThread.OOMEventListener _oomListener;
    8483    private ShutdownHook _shutdownHook;
    85     /** non-cancellable shutdown has begun */
    86     private volatile boolean _shutdownInProgress;
    8784    private I2PThread _gracefulShutdownDetector;
    8885    private RouterWatchdog _watchdog;
    8986    private Thread _watchdogThread;
    9087    private final EventLog _eventLog;
     88    private final Object _stateLock = new Object();
     89    private State _state = State.UNINITIALIZED;
    9190   
    9291    public final static String PROP_CONFIG_FILE = "router.configLocation";
     
    106105    public final static String PROP_HIDDEN_HIDDEN = "router.isHidden";
    107106    public final static String PROP_DYNAMIC_KEYS = "router.dynamicKeys";
    108     public final static String PROP_SHUTDOWN_IN_PROGRESS = "__shutdownInProgress";
     107    /** deprecated, use gracefulShutdownInProgress() */
     108    private final static String PROP_SHUTDOWN_IN_PROGRESS = "__shutdownInProgress";
    109109    private static final String PROP_IB_RANDOM_KEY = TunnelPoolSettings.PREFIX_INBOUND_EXPLORATORY + TunnelPoolSettings.PROP_RANDOM_KEY;
    110110    private static final String PROP_OB_RANDOM_KEY = TunnelPoolSettings.PREFIX_OUTBOUND_EXPLORATORY + TunnelPoolSettings.PROP_RANDOM_KEY;
     
    288288            saveConfig();
    289289        }
     290        changeState(State.INITIALIZED);
    290291        // *********  Start no threads before here ********* //
    291292    }
     
    460461     *  checks for updates and then calls this.
    461462     *
     463     *  This may take quite a while, especially if NTP fails.
     464     *
    462465     *  @since public as of 0.9 for Android and other embedded uses
    463466     */
    464467    public synchronized void runRouter() {
    465         if (_isAlive)
    466             throw new IllegalStateException();
     468        synchronized(_stateLock) {
     469            if (_state != State.INITIALIZED)
     470                throw new IllegalStateException();
     471            changeState(State.STARTING_1);
     472        }
    467473        String last = _config.get("router.previousFullVersion");
    468474        if (last != null) {
     
    472478        _eventLog.addEvent(EventLog.STARTED, RouterVersion.FULL_VERSION);
    473479        startupStuff();
    474         _isAlive = true;
     480        changeState(State.STARTING_2);
    475481        _started = _context.clock().now();
    476482        try {
     
    519525            _log.info("Waited " + waited + "ms to initialize");
    520526
     527        changeState(State.STARTING_3);
    521528        _context.jobQueue().addJob(new StartupJob(_context));
    522529    }
     
    574581        return props;
    575582    }
    576    
    577     public boolean isAlive() { return _isAlive; }
    578    
     583
     584    ////////// begin state management
     585   
     586    /**
     587     *  Startup / shutdown states
     588     *
     589     *  @since 0.9.18
     590     */
     591    private enum State {
     592        UNINITIALIZED,
     593        /** constructor complete */
     594        INITIALIZED,
     595        /** runRouter() called */
     596        STARTING_1,
     597        /** startupStuff() complete, most of the time here is NTP */
     598        STARTING_2,
     599        /** NTP done, Job queue started, StartupJob queued, runRouter() returned */
     600        STARTING_3,
     601        /** RIs loaded. From STARTING_3 */
     602        NETDB_READY,
     603        /** Non-zero-hop expl. tunnels built. From STARTING_3 */
     604        EXPL_TUNNELS_READY,
     605        /** from NETDB_READY or EXPL_TUNNELS_READY */
     606        RUNNING,
     607        /**
     608         *  A "soft" restart, primarily of the comm system, after
     609         *  a port change or large step-change in system time.
     610         *  Does not stop the whole JVM, so it is safe even in the absence
     611         *  of the wrapper.
     612         *  This is not a graceful restart - all peer connections are dropped immediately.
     613         */
     614        RESTARTING,
     615        /** cancellable shutdown has begun */
     616        GRACEFUL_SHUTDOWN,
     617        /** In shutdown(). Non-cancellable shutdown has begun */
     618        FINAL_SHUTDOWN_1,
     619        /** In shutdown2(). Killing everything */
     620        FINAL_SHUTDOWN_2,
     621        /** In finalShutdown(). Final cleanup */
     622        FINAL_SHUTDOWN_3,
     623        /** all done */
     624        STOPPED
     625    }
     626   
     627    /**
     628     *  @since 0.9.18
     629     */
     630    private void changeState(State state) {
     631        State oldState;
     632        synchronized(_stateLock) {
     633            oldState = _state;
     634            _state = state;
     635        }
     636        if (_log != null && state != State.STOPPED && _log.shouldLog(Log.WARN))
     637            _log.warn("Router state change from " + oldState + " to " + state /* , new Exception() */ );
     638    }
     639
     640    /**
     641     *  True during the initial start, but false during a soft restart.
     642     */
     643    public boolean isAlive() {
     644        synchronized(_stateLock) {
     645            return _state == State.RUNNING ||
     646                   _state == State.GRACEFUL_SHUTDOWN ||
     647                   _state == State.STARTING_1 ||
     648                   _state == State.STARTING_2 ||
     649                   _state == State.STARTING_3 ||
     650                   _state == State.NETDB_READY ||
     651                   _state == State.EXPL_TUNNELS_READY;
     652        }
     653    }
     654
     655    /**
     656     *  Only for Restarter, after soft restart is complete
     657     *  @since 0.8.12
     658     */
     659    public void setIsAlive() {
     660        changeState(State.RUNNING);
     661    }
     662
     663    /**
     664     *  Only for NetDB, after RIs are loaded
     665     *  @since 0.9.18
     666     */
     667    public void setNetDbReady() {
     668        synchronized(_stateLock) {
     669            if (_state == State.STARTING_3)
     670                changeState(State.NETDB_READY);
     671            else if (_state == State.EXPL_TUNNELS_READY)
     672                changeState(State.RUNNING);
     673        }
     674    }
     675
     676    /**
     677     *  Only for Tunnel Building, after we have non-zero-hop expl. tunnels
     678     *  @since 0.9.18
     679     */
     680    public void setExplTunnelsReady() {
     681        synchronized(_stateLock) {
     682            if (_state == State.STARTING_3)
     683                changeState(State.EXPL_TUNNELS_READY);
     684            else if (_state == State.NETDB_READY)
     685                changeState(State.RUNNING);
     686        }
     687    }
     688
     689    /**
     690     * Is a graceful shutdown in progress? This may be cancelled.
     691     * Note that this also returns true if an uncancellable final shutdown is in progress.
     692     */
     693    public boolean gracefulShutdownInProgress() {
     694        synchronized(_stateLock) {
     695            return _state == State.GRACEFUL_SHUTDOWN ||
     696                   _state == State.FINAL_SHUTDOWN_1 ||
     697                   _state == State.FINAL_SHUTDOWN_2 ||
     698                   _state == State.FINAL_SHUTDOWN_3 ||
     699                   _state == State.STOPPED;
     700        }
     701    }
     702
     703    /**
     704     * Is a final shutdown in progress? This may not be cancelled.
     705     * @since 0.8.12
     706     */
     707    public boolean isFinalShutdownInProgress() {
     708        synchronized(_stateLock) {
     709            return _state == State.FINAL_SHUTDOWN_1 ||
     710                   _state == State.FINAL_SHUTDOWN_2 ||
     711                   _state == State.FINAL_SHUTDOWN_3 ||
     712                   _state == State.STOPPED;
     713        }
     714    }
     715
     716    ////////// end state management
     717
    579718    /**
    580719     * Rebuild and republish our routerInfo since something significant
     
    802941     */
    803942    public synchronized void shutdown(int exitCode) {
    804         if (_shutdownInProgress)
    805             return;
    806         _shutdownInProgress = true;
     943        synchronized(_stateLock) {
     944            if (_state == State.FINAL_SHUTDOWN_1 ||
     945                _state == State.FINAL_SHUTDOWN_2 ||
     946                _state == State.FINAL_SHUTDOWN_3 ||
     947                _state == State.STOPPED)
     948                return;
     949            changeState(State.FINAL_SHUTDOWN_1);
     950        }
    807951        _context.throttle().setShutdownStatus();
    808952        if (_shutdownHook != null) {
     
    820964     */
    821965    public synchronized void shutdown2(int exitCode) {
     966        changeState(State.FINAL_SHUTDOWN_2);
    822967        // help us shut down esp. after OOM
    823968        int priority = (exitCode == EXIT_OOM) ? Thread.MAX_PRIORITY - 1 : Thread.NORM_PRIORITY + 2;
    824969        Thread.currentThread().setPriority(priority);
    825         _shutdownInProgress = true;
    826970        _log.log(Log.CRIT, "Starting final shutdown(" + exitCode + ')');
    827971        // So we can get all the way to the end
     
    833977        }
    834978        ((RouterClock) _context.clock()).removeShiftListener(this);
    835         _isAlive = false;
    836979        _context.random().saveSeed();
    837980        I2PThread.removeOOMEventListener(_oomListener);
     
    9171060     */
    9181061    private synchronized void finalShutdown(int exitCode) {
     1062        changeState(State.FINAL_SHUTDOWN_3);
    9191063        clearCaches();
    9201064        _log.log(Log.CRIT, "Shutdown(" + exitCode + ") complete"  /* , new Exception("Shutdown") */ );
     
    9491093            Runtime.getRuntime().gc();
    9501094        }
     1095        changeState(State.STOPPED);
    9511096    }
    9521097   
     
    9631108        shutdownGracefully(EXIT_GRACEFUL);
    9641109    }
     1110
    9651111    /**
    9661112     * Call this with EXIT_HARD or EXIT_HARD_RESTART for a non-blocking,
    9671113     * hard, non-graceful shutdown with a brief delay to allow a UI response
     1114     *
     1115     * Returns silently if a final shutdown is already in progress.
    9681116     */
    9691117    public void shutdownGracefully(int exitCode) {
     1118        synchronized(_stateLock) {
     1119            if (isFinalShutdownInProgress())
     1120                return; // too late
     1121            changeState(State.GRACEFUL_SHUTDOWN);
     1122        }
    9701123        _gracefulExitCode = exitCode;
    971         _config.put(PROP_SHUTDOWN_IN_PROGRESS, "true");
     1124        //_config.put(PROP_SHUTDOWN_IN_PROGRESS, "true");
    9721125        _context.throttle().setShutdownStatus();
    9731126        synchronized (_gracefulShutdownDetector) {
     
    9791132     * Cancel any prior request to shut the router down gracefully.
    9801133     *
     1134     * Returns silently if a final shutdown is already in progress.
    9811135     */
    9821136    public void cancelGracefulShutdown() {
     1137        synchronized(_stateLock) {
     1138            if (isFinalShutdownInProgress())
     1139                return; // too late
     1140            changeState(State.RUNNING);
     1141        }
    9831142        _gracefulExitCode = -1;
    984         _config.remove(PROP_SHUTDOWN_IN_PROGRESS);
     1143        //_config.remove(PROP_SHUTDOWN_IN_PROGRESS);
    9851144        _context.throttle().cancelShutdownStatus();
    9861145        synchronized (_gracefulShutdownDetector) {
     
    9931152     */
    9941153    public int scheduledGracefulExitCode() { return _gracefulExitCode; }
    995 
    996     /**
    997      * Is a graceful shutdown in progress? This may be cancelled.
    998      */
    999     public boolean gracefulShutdownInProgress() {
    1000         return (null != _config.get(PROP_SHUTDOWN_IN_PROGRESS));
    1001     }
    1002 
    1003     /**
    1004      * Is a final shutdown in progress? This may not be cancelled.
    1005      * @since 0.8.12
    1006      */
    1007     public boolean isFinalShutdownInProgress() {
    1008         return _shutdownInProgress;
    1009     }
    10101154
    10111155    /** How long until the graceful shutdown will kill us?  */
     
    10951239     */
    10961240    public void clockShift(long delta) {
    1097         if (gracefulShutdownInProgress() || !_isAlive)
    1098             return;
     1241        synchronized(_stateLock) {
     1242            if (gracefulShutdownInProgress() || !isAlive())
     1243                return;
     1244        }
    10991245        if (delta > -60*1000 && delta < 60*1000)
    11001246            return;
     
    11221268     */
    11231269    public synchronized void restart() {
    1124         if (gracefulShutdownInProgress() || !_isAlive)
    1125             return;
     1270        synchronized(_stateLock) {
     1271            if (gracefulShutdownInProgress() || !isAlive())
     1272                return;
     1273            changeState(State.RESTARTING);
     1274        }
    11261275        ((RouterClock) _context.clock()).removeShiftListener(this);
    1127         _isAlive = false;
    11281276        _started = _context.clock().now();
    11291277        Thread t = new Thread(new Restarter(_context), "Router Restart");
     
    11311279        t.start();
    11321280    }   
    1133 
    1134     /**
    1135      *  Only for Restarter
    1136      *  @since 0.8.12
    1137      */
    1138     public void setIsAlive() {
    1139         _isAlive = true;
    1140     }
    11411281
    11421282    /**
  • router/java/src/net/i2p/router/RouterThrottleImpl.java

    rb3238079 r37f34d8  
    108108     */
    109109    public int acceptTunnelRequest() {
    110         if (_context.getProperty(Router.PROP_SHUTDOWN_IN_PROGRESS) != null) {
     110        if (_context.router().gracefulShutdownInProgress()) {
    111111            if (_log.shouldLog(Log.WARN))
    112112                _log.warn("Refusing tunnel request since we are shutting down ASAP");
  • router/java/src/net/i2p/router/RouterVersion.java

    rb3238079 r37f34d8  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 6;
     21    public final static long BUILD = 7;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java

    rb3238079 r37f34d8  
    6767    private boolean shouldBeFloodfill() {
    6868        // Only if not shutting down...
    69         if (getContext().getProperty(Router.PROP_SHUTDOWN_IN_PROGRESS) != null)
     69        if (getContext().router().gracefulShutdownInProgress())
    7070            return false;
    7171
  • router/java/src/net/i2p/router/networkdb/kademlia/PersistentDataStore.java

    rb3238079 r37f34d8  
    430430           
    431431            if (!_initialized) {
    432                 if (_facade.reseedChecker().checkReseed(routerCount))
     432                if (_facade.reseedChecker().checkReseed(routerCount)) {
    433433                    _lastReseed = _context.clock().now();
     434                    // checkReseed will call wakeup() when done and we will run again
     435                } else {
     436                    _context.router().setNetDbReady();
     437                }
    434438                _initialized = true;
    435439            } else if (_lastReseed < _context.clock().now() - MIN_RESEED_INTERVAL) {
     
    438442                    if (_facade.reseedChecker().checkReseed(count))
    439443                        _lastReseed = _context.clock().now();
     444                        // checkReseed will call wakeup() when done and we will run again
     445                } else {
     446                    _context.router().setNetDbReady();
    440447                }
    441448            }
  • router/java/src/net/i2p/router/startup/ClientAppConfig.java

    rb3238079 r37f34d8  
    6666public class ClientAppConfig {
    6767    /** wait 2 minutes before starting up client apps */
    68     private final static long STARTUP_DELAY = 2*60*1000;
     68    private final static long DEFAULT_STARTUP_DELAY = 2*60*1000;
     69    /** speed up i2ptunnel without rewriting clients.config */
     70    private final static long I2PTUNNEL_STARTUP_DELAY = 35*1000;
    6971   
    7072    private static final String PROP_CLIENT_CONFIG_FILENAME = "router.clientConfigFile";
     
    184186                onStartup = "true".equals(onBoot) || "yes".equals(onBoot);
    185187
    186             long delay = (onStartup ? 0 : STARTUP_DELAY);
     188            // speed up the start of i2ptunnel for everybody without rewriting clients.config
     189            long delay = onStartup ? 0 :
     190                                   (className.equals("net.i2p.i2ptunnel.TunnelControllerGroup") ?
     191                                    I2PTUNNEL_STARTUP_DELAY : DEFAULT_STARTUP_DELAY);
    187192            if (delayStr != null && !onStartup)
    188193                try { delay = 1000*Integer.parseInt(delayStr); } catch (NumberFormatException nfe) {}
  • router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java

    rb3238079 r37f34d8  
    6363    private final AtomicInteger _currentLookups = new AtomicInteger();
    6464    private volatile boolean _isRunning;
     65    private final Object _startupLock = new Object();
     66    private ExplState _explState = ExplState.NONE;
     67
     68    private enum ExplState { NONE, IB, OB, BOTH }
    6569
    6670    /** TODO these may be too high, review and adjust */
     
    153157        ctx.inNetMessagePool().registerHandlerJobBuilder(VariableTunnelBuildReplyMessage.MESSAGE_TYPE, tbrmhjb);
    154158    }
     159
     160    /**
     161     *  Call the same time you start the threads
     162     *
     163     *  @since 0.9.18
     164     */
     165    void init() {
     166        // fixup startup state if 0-hop exploratory is allowed in either direction
     167        int ibl = _manager.getInboundSettings().getLength();
     168        int ibv = _manager.getInboundSettings().getLengthVariance();
     169        int obl = _manager.getOutboundSettings().getLength();
     170        int obv = _manager.getOutboundSettings().getLengthVariance();
     171        boolean ibz = ibl <= 0 || ibl + ibv <= 0;
     172        boolean obz = obl <= 0 || obl + obv <= 0;
     173        if (ibz && obz) {
     174            _explState = ExplState.BOTH;
     175            _context.router().setExplTunnelsReady();
     176        } else if (ibz) {
     177            _explState = ExplState.IB;
     178        } else if (obz) {
     179            _explState = ExplState.OB;
     180        }
     181    }
     182
    155183   
    156184    /**
     
    338366                _exec.buildComplete(cfg, cfg.getTunnelPool());
    339367                _exec.buildSuccessful(cfg);
     368
     369                if (cfg.getTunnelPool().getSettings().isExploratory()) {
     370                    // Notify router that exploratory tunnels are ready
     371                    boolean isIn = cfg.isInbound();
     372                    synchronized(_startupLock) {
     373                        switch (_explState) {
     374                            case NONE:
     375                                if (isIn)
     376                                    _explState = ExplState.IB;
     377                                else
     378                                    _explState = ExplState.OB;
     379                                break;
     380
     381                            case IB:
     382                                if (!isIn) {
     383                                    _explState = ExplState.BOTH;
     384                                    _context.router().setExplTunnelsReady();
     385                                }
     386                                break;
     387
     388                            case OB:
     389                                if (isIn) {
     390                                    _explState = ExplState.BOTH;
     391                                    _context.router().setExplTunnelsReady();
     392                                }
     393                                break;
     394
     395                            case BOTH:
     396                                break;
     397                        }
     398                    }
     399                }
    340400               
    341401                ExpireJob expireJob = new ExpireJob(_context, cfg, cfg.getTunnelPool());
  • router/java/src/net/i2p/router/tunnel/pool/BuildRequestor.java

    rb3238079 r37f34d8  
    139139                    if (pairedTunnel != null &&
    140140                        pairedTunnel.getLength() <= 1 &&
     141                        mgr.getOutboundSettings().getLength() > 0 &&
    141142                        mgr.getOutboundSettings().getLength() + mgr.getOutboundSettings().getLengthVariance() > 0) {
    142143                        // don't build using a zero-hop expl.,
     
    151152                    if (pairedTunnel != null &&
    152153                        pairedTunnel.getLength() <= 1 &&
     154                        mgr.getInboundSettings().getLength() > 0 &&
    153155                        mgr.getInboundSettings().getLength() + mgr.getInboundSettings().getLengthVariance() > 0) {
    154156                        // ditto
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java

    rb3238079 r37f34d8  
    9090        _lastLifetimeProcessed = 0;
    9191        _manager.getExecutor().repoll();
    92         if (_settings.isInbound() && (_settings.getDestination() != null) ) {
     92        if (_settings.isInbound() && !_settings.isExploratory()) {
    9393            // we just reconnected and didn't require any new tunnel builders.
    9494            // however, we /do/ want a leaseSet, so build one
     
    118118    }
    119119
    120     TunnelPoolManager getManager() { return _manager; }
    121    
    122120    void refreshSettings() {
    123         if (_settings.getDestination() != null) {
     121        if (!_settings.isExploratory()) {
    124122            return; // don't override client specified settings
    125123        } else {
     
    161159
    162160    private TunnelInfo selectTunnel(boolean allowRecurseOnFail) {
    163         boolean avoidZeroHop = ((getSettings().getLength() + getSettings().getLengthVariance()) > 0);
     161        boolean avoidZeroHop = getSettings().getLength() > 0 &&
     162                               getSettings().getLength() + getSettings().getLengthVariance() > 0;
    164163       
    165164        long period = curPeriod();
     
    248247     */
    249248    TunnelInfo selectTunnel(Hash closestTo) {
    250         boolean avoidZeroHop = ((getSettings().getLength() + getSettings().getLengthVariance()) > 0);
     249        boolean avoidZeroHop = getSettings().getLength() > 0 &&
     250                               getSettings().getLength() + getSettings().getLengthVariance() > 0;
    251251        TunnelInfo rv = null;
    252252        synchronized (_tunnels) {
     
    420420        return _alive &&
    421421               (_settings.isExploratory() ||
    422                 (_settings.getDestination() != null &&
    423                  _context.clientManager().isLocal(_settings.getDestination())));
     422                 _context.clientManager().isLocal(_settings.getDestination()));
    424423    }
    425424
     
    440439        synchronized (_tunnels) {
    441440            _tunnels.add(info);
    442             if (_settings.isInbound() && (_settings.getDestination() != null) )
     441            if (_settings.isInbound() && !_settings.isExploratory())
    443442                ls = locked_buildNewLeaseSet();
    444443        }
     
    460459            if (!removed)
    461460                return;
    462             if (_settings.isInbound() && (_settings.getDestination() != null) )
     461            if (_settings.isInbound() && !_settings.isExploratory())
    463462                ls = locked_buildNewLeaseSet();
    464463            remaining = _tunnels.size();
     
    479478            _context.profileManager().tunnelLifetimePushed(info.getPeer(i), lifetime, lifetimeConfirmed);
    480479       
    481         if (_alive && _settings.isInbound() && (_settings.getDestination() != null) ) {
     480        if (_alive && _settings.isInbound() && !_settings.isExploratory()) {
    482481            if (ls != null) {
    483482                _context.clientManager().requestLeaseSet(_settings.getDestination(), ls);
     
    529528            if (!removed)
    530529                return;
    531             if (_settings.isInbound() && (_settings.getDestination() != null) )
     530            if (_settings.isInbound() && !_settings.isExploratory())
    532531                ls = locked_buildNewLeaseSet();
    533532            if (_lastSelected == cfg) {
     
    542541        updateRate();
    543542       
    544         if (_settings.isInbound() && (_settings.getDestination() != null) ) {
     543        if (_settings.isInbound() && !_settings.isExploratory()) {
    545544            if (ls != null) {
    546545                _context.clientManager().requestLeaseSet(_settings.getDestination(), ls);
     
    591590    /** noop for outbound and exploratory */
    592591    void refreshLeaseSet() {
    593         if (_settings.isInbound() && (_settings.getDestination() != null) ) {
     592        if (_settings.isInbound() && !_settings.isExploratory()) {
    594593            if (_log.shouldLog(Log.DEBUG))
    595594                _log.debug(toString() + ": refreshing leaseSet on tunnel expiration (but prior to grace timeout)");
     
    619618        if (_settings.getAllowZeroHop()) {
    620619            if ( (_settings.getLength() + _settings.getLengthVariance() > 0) &&
    621                  (_settings.getDestination() != null) &&
     620                 (!_settings.isExploratory()) &&
    622621                 (_context.profileOrganizer().countActivePeers() > 0) ) {
    623622                // if it is a client tunnel pool and our variance doesn't allow 0 hop, prefer failure to
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java

    rb3238079 r37f34d8  
    345345    }
    346346
     347    /** exploratory */
    347348    public TunnelPoolSettings getInboundSettings() { return _inboundExploratory.getSettings(); }
     349
     350    /** exploratory */
    348351    public TunnelPoolSettings getOutboundSettings() { return _outboundExploratory.getSettings(); }
     352
     353    /** exploratory */
    349354    public void setInboundSettings(TunnelPoolSettings settings) { _inboundExploratory.setSettings(settings); }
     355
     356    /** exploratory */
    350357    public void setOutboundSettings(TunnelPoolSettings settings) { _outboundExploratory.setSettings(settings); }
    351358
     
    498505            I2PThread t = new I2PThread(_executor, "BuildExecutor", true);
    499506            t.start();
     507            _handler.init();
    500508            for (int i = 1; i <= _numHandlerThreads; i++) {
    501509                I2PThread hThread = new I2PThread(_handler, "BuildHandler " + i + '/' + _numHandlerThreads, true);
Note: See TracChangeset for help on using the changeset viewer.