Compare commits

...

7 Commits

Author SHA1 Message Date
eyedeekay
9c6d444f3f Router: Revise lookup throttle times 2023-11-07 15:42:57 -05:00
eyedeekay
6ba84f7076 Merge branch 'master' of i2pgit.org:i2p-hackers/i2p.i2p into i2p.i2p.2.4.0-reverse-throttler 2023-11-07 14:38:00 -05:00
eyedeekay
fbb53802c7 Router: remove the lookup throttler 2023-11-05 20:59:25 -05:00
eyedeekay
6df76bb42c Merge branch 'master' of i2pgit.org:i2p-hackers/i2p.i2p into
i2p.i2p.2.4.0-reverse-throttler
2023-11-05 20:44:55 -05:00
eyedeekay
6bf2cc856d Merge branch 'master' of i2pgit.org:i2p-hackers/i2p.i2p into
i2p.i2p.2.4.0-reverse-throttler
2023-11-05 20:39:25 -05:00
eyedeekay
8ae54270c9 Router: remove MIN_VERSION_HONOR_CAPS from BuildHandler 2023-11-03 10:19:48 -04:00
eyedeekay
fdb6701bf5 Router: remove unused code and imports in BuildHandler 2023-10-31 14:06:20 -04:00
3 changed files with 3 additions and 13 deletions

View File

@@ -83,8 +83,7 @@ public class FloodfillDatabaseLookupMessageHandler implements HandlerJobBuilder
_context.statManager().addRateData("netDb.nonFFLookupsDropped", 1);
return null;
}
if ((!_facade.shouldThrottleLookup(dlm.getFrom(), dlm.getReplyTunnel())
&& !_facade.shouldThrottleBurstLookup(dlm.getFrom(), dlm.getReplyTunnel()))
if (!_facade.shouldThrottleLookup(dlm.getFrom(), dlm.getReplyTunnel())
|| _context.routerHash().equals(dlm.getFrom())) {
Job j = new HandleFloodfillDatabaseLookupMessageJob(_context, dlm, from, fromHash, _msgIDBloomXor);
// if (false) {

View File

@@ -41,10 +41,7 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
private final Set<Hash> _verifiesInProgress;
private FloodThrottler _floodThrottler;
private LookupThrottler _lookupThrottler;
private LookupThrottler _lookupThrottlerBurst;
private final Job _ffMonitor;
private final int DROP_LOOKUP_BURST = 10;
private final int DROP_LOOKUP_BURST_INTERVAL = 30*1000;
/**
* This is the flood redundancy. Entries are
@@ -112,7 +109,6 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
} else {
isFF = _context.getBooleanProperty(FloodfillMonitorJob.PROP_FLOODFILL_PARTICIPANT);
_lookupThrottler = new LookupThrottler();
_lookupThrottlerBurst = new LookupThrottler(DROP_LOOKUP_BURST, DROP_LOOKUP_BURST_INTERVAL);
}
long down = _context.router().getEstimatedDowntime();
@@ -240,11 +236,6 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
return _lookupThrottler == null || _lookupThrottler.shouldThrottle(from, id);
}
boolean shouldThrottleBurstLookup(Hash from, TunnelId id) {
// null before startup
return _lookupThrottlerBurst == null || _lookupThrottlerBurst.shouldThrottle(from, id);
}
/**
* If we are floodfill AND the key is not throttled,
* flood it, otherwise don't.

View File

@@ -23,8 +23,8 @@ class LookupThrottler {
private final int MAX_LOOKUPS; // DEFAULT=20
private final long CLEAN_TIME; // DEFAULT=3*60*1000
LookupThrottler() {
MAX_LOOKUPS = 20;
CLEAN_TIME = 3*60*1000;
MAX_LOOKUPS = 14;
CLEAN_TIME = 2*60*1000;
this.counter = new ObjectCounter<ReplyTunnel>();
SimpleTimer2.getInstance().addPeriodicEvent(new Cleaner(), CLEAN_TIME);
}