Changeset 3455d3f


Ignore:
Timestamp:
Jul 10, 2011 3:04:42 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
0ca035d
Parents:
42acdc3
Message:
  • Message Registry: Clear pending messages at restart / shutdown
  • OCMOSJ: Clear caches at restart
  • UPnP:
    • Fix device rediscovery and port opening after restart
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • history.txt

    r42acdc3 r3455d3f  
     12011-07-10 zzz
     2  * DH, YK:
     3    - Improve YK speed test
     4    - Shut down thread faster
     5    - Refiller keeps going until full
     6    - Cleanups
     7  * I2PTunnel: Fix a shutdown hang
     8  * Message Registry: Clear pending messages at restart / shutdown
     9  * OCMOSJ: Clear caches at restart
     10  * Router Clock: First cut at recognizing and reacting to large system
     11    clock shifts by partially restarting the router. Also improve
     12    restarts initiated from config.jsp
     13    Tickets #465, #468, #494
     14  * UPnP:
     15    - Wait for a while to ensure port removal at shutdown or restart
     16    - Fix device rediscovery and port opening after restart
     17
    1182011-07-08 zzz
    219  * Findbugs: Several fixes and cleanups
  • router/java/src/net/i2p/router/ClientMessagePool.java

    r42acdc3 r3455d3f  
    3838    public void shutdown() {
    3939        OutboundClientMessageOneShotJob.clearAllCaches();
     40    }
     41
     42    /**
     43     *  @since 0.8.8
     44     */
     45    public void restart() {
     46        shutdown();
    4047    }
    4148
  • router/java/src/net/i2p/router/InNetMessagePool.java

    r42acdc3 r3455d3f  
    322322   
    323323    public void renderStatusHTML(Writer out) {}
     324
     325    /** does nothing since we aren't threaded */
    324326    public void restart() {
    325327        shutdown();
     
    327329        startup();
    328330    }
     331
     332    /** does nothing since we aren't threaded */
    329333    public void shutdown() {
    330334        _alive = false;
     
    338342    }
    339343   
     344    /** does nothing since we aren't threaded */
    340345    public void startup() {
    341346        _alive = true;
  • router/java/src/net/i2p/router/Router.java

    r42acdc3 r3455d3f  
    12591259            try { _context.clientManager().shutdown(); } catch (Throwable t) { _log.log(Log.CRIT, "Error stopping the client manager", t); }
    12601260            _log.logAlways(Log.WARN, "Stopping the comm system");
     1261            try { _context.messageRegistry().restart(); } catch (Throwable t) { _log.log(Log.CRIT, "Error restarting the message registry", t); }
    12611262            try { _context.commSystem().restart(); } catch (Throwable t) { _log.log(Log.CRIT, "Error restarting the comm system", t); }
    12621263            _log.logAlways(Log.WARN, "Stopping the tunnel manager");
     
    12731274            _log.logAlways(Log.WARN, "Restarting the tunnel manager");
    12741275            _log.logAlways(Log.WARN, "Restarting the client manager");
    1275             try { _context.clientManager().startup(); } catch (Throwable t) { _log.log(Log.CRIT, "Error stopping the client manager", t); }
     1276            try { _context.clientMessagePool().restart(); } catch (Throwable t) { _log.log(Log.CRIT, "Error restarting the CMP", t); }
     1277            try { _context.clientManager().startup(); } catch (Throwable t) { _log.log(Log.CRIT, "Error starting the client manager", t); }
    12761278       
    12771279            _isAlive = true;
  • router/java/src/net/i2p/router/RouterVersion.java

    r42acdc3 r3455d3f  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 8;
     21    public final static long BUILD = 9;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/transport/OutboundMessageRegistry.java

    r42acdc3 r3455d3f  
    2929
    3030public class OutboundMessageRegistry {
    31     private Log _log;
     31    private final Log _log;
    3232    /** list of currently active MessageSelector instances */
    3333    private final List _selectors;
     
    3636    /** set of active OutNetMessage (for quick removal and selector fetching) */
    3737    private final Set _activeMessages;
    38     private CleanupTask _cleanupTask;
    39     private RouterContext _context;
     38    private final CleanupTask _cleanupTask;
     39    private final RouterContext _context;
    4040   
    4141    public OutboundMessageRegistry(RouterContext context) {
     
    4848    }
    4949   
    50     public void shutdown() {}
     50    /**
     51     *  Does something @since 0.8.8
     52     */
     53    public void shutdown() {
     54        synchronized (_selectors) {
     55            _selectors.clear();
     56        }
     57        synchronized (_selectorToMessage) {
     58            _selectorToMessage.clear();
     59        }
     60        // Calling the fail job for every active message would
     61        // be way too much at shutdown/restart, right?
     62        synchronized (_activeMessages) {
     63            _activeMessages.clear();
     64        }
     65    }
     66   
     67    /**
     68     *  @since 0.8.8
     69     */
     70    public void restart() {
     71        shutdown();
     72    }
    5173   
    5274    /**
  • router/java/src/net/i2p/router/transport/UPnP.java

    r42acdc3 r3455d3f  
    8989       
    9090        public boolean runPlugin() {
     91                synchronized(lock) {
     92                        portsToForward = null;
     93                }
    9194                return super.start();
    9295        }
     
    9699         */
    97100        public void terminate() {
     101                synchronized(lock) {
     102                        portsToForward = null;
     103                }
    98104                // this gets spun off in a thread...
    99105                unregisterPortMappings();
     
    622628                                portsToForward = ports;
    623629                        }
    624                         if(_router == null) return; // When one is found, we will do the forwards
     630                        if(_router == null) {
     631                                if (_log.shouldLog(Log.WARN))
     632                                        _log.warn("No UPnP router available to update");
     633                                return; // When one is found, we will do the forwards
     634                        }
    625635                }
    626636                if(portsToDumpNow != null)
     
    646656         */
    647657        private void registerPorts(Set<ForwardPort> portsToForwardNow) {
     658                if (_log.shouldLog(Log.INFO))
     659                        _log.info("Starting thread to forward " + portsToForwardNow.size() + " ports");
    648660                Thread t = new Thread(new RegisterPortsThread(portsToForwardNow));
    649661                t.setName("UPnP Port Opener " + (++__id));
     
    684696         */
    685697        private void unregisterPorts(Set<ForwardPort> portsToForwardNow) {
     698                if (_log.shouldLog(Log.INFO))
     699                        _log.info("Starting thread to un-forward " + portsToForwardNow.size() + " ports");
    686700                Thread t = new Thread(new UnregisterPortsThread(portsToForwardNow));
    687701                t.setName("UPnP Port Closer " + (++__id));
  • router/java/src/net/i2p/router/transport/UPnPManager.java

    r42acdc3 r3455d3f  
    6161   
    6262    public synchronized void start() {
     63        if (_log.shouldLog(Log.DEBUG))
     64            _log.debug("UPnP Start");
    6365        if (!_isRunning)
    6466            _isRunning = _upnp.runPlugin();
     
    8486    public void update(Map<String, Integer> ports) {
    8587        if (_log.shouldLog(Log.DEBUG))
    86             _log.debug("UPnP Update:");
     88            _log.debug("UPnP Update with " + ports.size() + " ports");
    8789        if (!_isRunning)
    8890            return;
  • router/java/src/org/cybergarage/upnp/ControlPoint.java

    r42acdc3 r3455d3f  
    915915                }
    916916               
     917                // I2P so we will re-notify on restart
     918                DeviceList dl = getDeviceList();
     919                for (int i = 0; i < dl.size(); i++) {
     920                        removeDevice(dl.getDevice(i));
     921                }
     922
    917923                return true;
    918924        }
Note: See TracChangeset for help on using the changeset viewer.