Changeset 62bf269
- Timestamp:
- Aug 29, 2008 1:15:28 PM (12 years ago)
- Branches:
- master
- Children:
- ef328ed3
- Parents:
- ee4d68c
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
history.txt
ree4d68c r62bf269 1 2008-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 1 8 2008-08-27 zzz 2 9 * Floodfill Peer Selector: Prefer already-connected floodfill -
router/java/src/net/i2p/router/ProfileManager.java
ree4d68c r62bf269 54 54 */ 55 55 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); 56 63 57 64 /** -
router/java/src/net/i2p/router/RouterVersion.java
ree4d68c r62bf269 18 18 public final static String ID = "$Revision: 1.548 $ $Date: 2008-06-07 23:00:00 $"; 19 19 public final static String VERSION = "0.6.3"; 20 public final static long BUILD = 1;20 public final static long BUILD = 2; 21 21 public static void main(String args[]) { 22 22 System.out.println("I2P Router version: " + VERSION + "-" + BUILD); -
router/java/src/net/i2p/router/peermanager/ProfileManagerImpl.java
ree4d68c r62bf269 105 105 106 106 /** 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 /** 107 119 * Note that a tunnel that the router is participating in 108 120 * was successfully tested with the given round trip latency -
router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java
ree4d68c r62bf269 68 68 69 69 private int allowed() { 70 StringBuffer buf = null;71 if (_log.shouldLog(Log.DEBUG)) {72 buf = new StringBuffer(128);73 buf.append("Allowed: ");74 }75 76 70 int maxKBps = _context.bandwidthLimiter().getOutboundKBytesPerSecond(); 77 71 int allowed = maxKBps / 6; // Max. 1 concurrent build per 6 KB/s outbound … … 100 94 concurrent = _currentlyBuilding.size(); 101 95 allowed -= concurrent; 102 if (buf != null)103 buf.append(allowed).append(" ").append(_currentlyBuilding.toString());104 96 } 105 97 … … 107 99 for (int i = 0; i < expired.size(); i++) { 108 100 PooledTunnelCreatorConfig cfg = (PooledTunnelCreatorConfig)expired.get(i); 109 // note the fact that this tunnel request timed out in the peers' profiles.110 // or... not.111 101 if (_log.shouldLog(Log.INFO)) 112 102 _log.info("Timed out waiting for reply asking for " + cfg); … … 114 104 // Iterate through peers in the tunnel, get their bandwidth tiers, 115 105 // 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. 116 107 for (int iPeer = 0; iPeer < cfg.getLength(); iPeer++) { 117 108 // Look up peer 118 109 Hash peer = cfg.getPeer(iPeer); 119 110 // 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())) 122 112 continue; 123 }124 113 // Look up routerInfo 125 114 RouterInfo ri = _context.netDb().lookupRouterInfoLocally(peer); … … 127 116 String bwTier = "Unknown"; 128 117 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);130 118 // Record that a peer of the given tier expired 131 119 _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 } 134 125 135 126 TunnelPool pool = cfg.getTunnelPool(); … … 140 131 else 141 132 _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 } 149 135 150 136 _context.statManager().addRateData("tunnel.concurrentBuilds", concurrent, 0); … … 168 154 169 155 // 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; 171 157 172 158 /**
Note: See TracChangeset
for help on using the changeset viewer.