forked from I2P_Developers/i2p.i2p
Job Queue:
- Drop garlic message decryption jobs on overload - Decrease overload threshold
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2015-03-13 zzz
|
||||||
|
* i2psnark:
|
||||||
|
- Auto-reduce tunnel quantity based on peer count
|
||||||
|
- Increase max tunnels
|
||||||
|
* Job Queue:
|
||||||
|
- Drop garlic message decryption jobs on overload
|
||||||
|
- Decrease overload threshold
|
||||||
|
|
||||||
2015-03-13 dg
|
2015-03-13 dg
|
||||||
* Router: create router.integratedPeers (floodfills) stat, and
|
* Router: create router.integratedPeers (floodfills) stat, and
|
||||||
allow graphing of it.
|
allow graphing of it.
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import java.util.concurrent.LinkedBlockingQueue;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import net.i2p.data.DataHelper;
|
import net.i2p.data.DataHelper;
|
||||||
|
import net.i2p.router.message.HandleGarlicMessageJob;
|
||||||
import net.i2p.router.networkdb.kademlia.HandleFloodfillDatabaseLookupMessageJob;
|
import net.i2p.router.networkdb.kademlia.HandleFloodfillDatabaseLookupMessageJob;
|
||||||
import net.i2p.util.Clock;
|
import net.i2p.util.Clock;
|
||||||
import net.i2p.util.I2PThread;
|
import net.i2p.util.I2PThread;
|
||||||
@@ -112,7 +113,9 @@ public class JobQueue {
|
|||||||
|
|
||||||
/** max ready and waiting jobs before we start dropping 'em */
|
/** max ready and waiting jobs before we start dropping 'em */
|
||||||
private int _maxWaitingJobs = DEFAULT_MAX_WAITING_JOBS;
|
private int _maxWaitingJobs = DEFAULT_MAX_WAITING_JOBS;
|
||||||
private final static int DEFAULT_MAX_WAITING_JOBS = 100;
|
private final static int DEFAULT_MAX_WAITING_JOBS = 50;
|
||||||
|
private final static long MIN_LAG_TO_DROP = 1000;
|
||||||
|
|
||||||
/** @deprecated unimplemented */
|
/** @deprecated unimplemented */
|
||||||
private final static String PROP_MAX_WAITING_JOBS = "router.maxWaitingJobs";
|
private final static String PROP_MAX_WAITING_JOBS = "router.maxWaitingJobs";
|
||||||
|
|
||||||
@@ -286,11 +289,15 @@ public class JobQueue {
|
|||||||
// we don't really *need* to answer DB lookup messages
|
// we don't really *need* to answer DB lookup messages
|
||||||
// This is pretty lame, there's actually a ton of different jobs we
|
// This is pretty lame, there's actually a ton of different jobs we
|
||||||
// could drop, but is it worth making a list?
|
// could drop, but is it worth making a list?
|
||||||
if (cls == HandleFloodfillDatabaseLookupMessageJob.class) {
|
//
|
||||||
|
// Garlic added in 0.9.19, floodfills were getting overloaded
|
||||||
|
// with encrypted lookups
|
||||||
|
if (cls == HandleFloodfillDatabaseLookupMessageJob.class ||
|
||||||
|
cls == HandleGarlicMessageJob.class) {
|
||||||
JobTiming jt = job.getTiming();
|
JobTiming jt = job.getTiming();
|
||||||
if (jt != null) {
|
if (jt != null) {
|
||||||
long lag = _context.clock().now() - jt.getStartAfter();
|
long lag = _context.clock().now() - jt.getStartAfter();
|
||||||
if (lag > 2*1000L)
|
if (lag >= MIN_LAG_TO_DROP)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 1;
|
public final static long BUILD = 2;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
|
|||||||
@@ -30,8 +30,10 @@ import net.i2p.util.Log;
|
|||||||
* It is not the handler for garlic messages received down a tunnel,
|
* It is not the handler for garlic messages received down a tunnel,
|
||||||
* as InNetMessagePool short circuits tunnel messages,
|
* as InNetMessagePool short circuits tunnel messages,
|
||||||
* and those garlic messages are handled in InboundMessageDistributor.
|
* and those garlic messages are handled in InboundMessageDistributor.
|
||||||
|
*
|
||||||
|
* Public for JobQueue as these jobs may be dropped.
|
||||||
*/
|
*/
|
||||||
class HandleGarlicMessageJob extends JobImpl implements GarlicMessageReceiver.CloveReceiver {
|
public class HandleGarlicMessageJob extends JobImpl implements GarlicMessageReceiver.CloveReceiver {
|
||||||
private final Log _log;
|
private final Log _log;
|
||||||
private final GarlicMessage _message;
|
private final GarlicMessage _message;
|
||||||
//private RouterIdentity _from;
|
//private RouterIdentity _from;
|
||||||
|
|||||||
Reference in New Issue
Block a user