Changeset 62bf269


Ignore:
Timestamp:
Aug 29, 2008 1:15:28 PM (13 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
ef328ed3
Parents:
ee4d68c
Message:
  • Profiles: Penalize capacity when tunnel build request times out
  • Tunnel BuildExecutor?: Debug cleanup
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • history.txt

    ree4d68c r62bf269  
     12008-08-29 zzz
     2    * Tunnel BuildExecutor: Debug cleanup
     3    * Profiles: Penalize capacity when tunnel build request times out
     4    * Shutdown: Call the shutdown hooks before the router shutdown
     5      rather than after
     6    * Stats: Remove tunnel.Bps.* stats when the tunnel pool is closed
     7
    182008-08-27 zzz
    29    * Floodfill Peer Selector: Prefer already-connected floodfill
  • router/java/src/net/i2p/router/ProfileManager.java

    ree4d68c r62bf269  
    5454     */
    5555    void tunnelRejected(Hash peer, long responseTimeMs, int severity);
     56   
     57    /**
     58     * Note that a router timed out joining a tunnel
     59     *
     60     * @param peer who rejected us
     61     */
     62    void tunnelTimedOut(Hash peer);
    5663   
    5764    /**
  • router/java/src/net/i2p/router/RouterVersion.java

    ree4d68c r62bf269  
    1818    public final static String ID = "$Revision: 1.548 $ $Date: 2008-06-07 23:00:00 $";
    1919    public final static String VERSION = "0.6.3";
    20     public final static long BUILD = 1;
     20    public final static long BUILD = 2;
    2121    public static void main(String args[]) {
    2222        System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
  • router/java/src/net/i2p/router/peermanager/ProfileManagerImpl.java

    ree4d68c r62bf269  
    105105   
    106106    /**
     107     * Note that a router did not respond to a tunnel join.
     108     *
     109     * Since TunnelHistory doesn't have a timeout stat, pretend we were
     110     * rejected for bandwidth reasons.
     111     */
     112    public void tunnelTimedOut(Hash peer) {
     113        PeerProfile data = getProfile(peer);
     114        if (data == null) return;
     115        data.getTunnelHistory().incrementRejected(TunnelHistory.TUNNEL_REJECT_BANDWIDTH);
     116    }
     117   
     118    /**
    107119     * Note that a tunnel that the router is participating in
    108120     * was successfully tested with the given round trip latency
  • router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java

    ree4d68c r62bf269  
    6868   
    6969    private int allowed() {
    70         StringBuffer buf = null;
    71         if (_log.shouldLog(Log.DEBUG)) {
    72             buf = new StringBuffer(128);
    73             buf.append("Allowed: ");
    74         }
    75 
    7670        int maxKBps = _context.bandwidthLimiter().getOutboundKBytesPerSecond();
    7771        int allowed = maxKBps / 6; // Max. 1 concurrent build per 6 KB/s outbound
     
    10094            concurrent = _currentlyBuilding.size();
    10195            allowed -= concurrent;
    102             if (buf != null)
    103                 buf.append(allowed).append(" ").append(_currentlyBuilding.toString());
    10496        }
    10597       
     
    10799            for (int i = 0; i < expired.size(); i++) {
    108100                PooledTunnelCreatorConfig cfg = (PooledTunnelCreatorConfig)expired.get(i);
    109                 // note the fact that this tunnel request timed out in the peers' profiles.
    110                 // or... not.
    111101                if (_log.shouldLog(Log.INFO))
    112102                    _log.info("Timed out waiting for reply asking for " + cfg);
     
    114104                // Iterate through peers in the tunnel, get their bandwidth tiers,
    115105                // record for each that a peer of the given tier expired
     106                // Also note the fact that this tunnel request timed out in the peers' profiles.
    116107                for (int iPeer = 0; iPeer < cfg.getLength(); iPeer++) {
    117108                    // Look up peer
    118109                    Hash peer = cfg.getPeer(iPeer);
    119110                    // Avoid recording ourselves
    120                     if (peer.toBase64().equals(_context.routerHash().toBase64())) {
    121                         if (_log.shouldLog(Log.DEBUG)) _log.debug("Not recording our own expiry in stats.");
     111                    if (peer.toBase64().equals(_context.routerHash().toBase64()))
    122112                        continue;
    123                     }
    124113                    // Look up routerInfo
    125114                    RouterInfo ri = _context.netDb().lookupRouterInfoLocally(peer);
     
    127116                    String bwTier = "Unknown";
    128117                    if (ri != null) bwTier = ri.getBandwidthTier(); // Returns "Unknown" if none recognized
    129                         else if (_log.shouldLog(Log.WARN)) _log.warn("Failed detecting bwTier, null routerInfo for: " + peer);
    130118                    // Record that a peer of the given tier expired
    131119                    _context.statManager().addRateData("tunnel.tierExpire" + bwTier, 1, 0);
    132                 }
    133 
     120                    didNotReply(cfg.getReplyMessageId(), peer);
     121                    // Blame everybody since we don't know whose fault it is.
     122                    // (it could be our exploratory tunnel's fault too...)
     123                    _context.profileManager().tunnelTimedOut(peer);
     124                }
    134125
    135126                TunnelPool pool = cfg.getTunnelPool();
     
    140131                else
    141132                    _context.statManager().addRateData("tunnel.buildClientExpire", 1, 0);
    142                 for (int j = 0; j < cfg.getLength(); j++)
    143                     didNotReply(cfg.getReplyMessageId(), cfg.getPeer(j));
    144             }
    145         }
    146        
    147         //if (buf != null)
    148         //    _log.debug(buf.toString());
     133            }
     134        }
    149135       
    150136        _context.statManager().addRateData("tunnel.concurrentBuilds", concurrent, 0);
     
    168154
    169155    // Estimated cost of tunnel build attempt, bytes
    170     private static final int BUILD_BANDWIDTH_ESTIMATE_BYTES = 5*1024;
     156    // private static final int BUILD_BANDWIDTH_ESTIMATE_BYTES = 5*1024;
    171157
    172158    /**
Note: See TracChangeset for help on using the changeset viewer.