cleanups and comments

This commit is contained in:
zzz
2011-09-12 13:11:57 +00:00
parent 16640722d6
commit 540172117f
4 changed files with 22 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2011-09-12 zzz
* Build Executor:
- Limit max parallel builds on really slow machines (ticket #519)
- Slow down build loop when network is apparently disconnected (ticket #519)
* NetDB: Disable floodfill at shutdown time if enabled
2011-09-09 zzz
* TunnelDispatcher: Fix bug in -13 preventing participating
tunnels from being expired and causing high CPU usage

View File

@ -26,7 +26,7 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import net.i2p.data.DataHelper;
import net.i2p.router.networkdb.HandleDatabaseLookupMessageJob;
import net.i2p.router.networkdb.kademlia.HandleFloodfillDatabaseLookupMessageJob;
import net.i2p.util.Clock;
import net.i2p.util.I2PThread;
import net.i2p.util.Log;
@ -175,7 +175,7 @@ public class JobQueue {
_timedJobs.remove(job);
}
if (shouldDrop(job, numReady)) {
if ((!alreadyExists) && shouldDrop(job, numReady)) {
job.dropped();
dropped = true;
} else {
@ -256,14 +256,16 @@ public class JobQueue {
private boolean shouldDrop(Job job, long numReady) {
if (_maxWaitingJobs <= 0) return false; // dont ever drop jobs
if (!_allowParallelOperation) return false; // dont drop during startup [duh]
Class cls = job.getClass();
if (numReady > _maxWaitingJobs) {
Class cls = job.getClass();
// lets not try to drop too many tunnel messages...
//if (cls == HandleTunnelMessageJob.class)
// return true;
// we don't really *need* to answer DB lookup messages
if (cls == HandleDatabaseLookupMessageJob.class)
// This is pretty lame, there's actually a ton of different jobs we
// could drop, but is it worth making a list?
if (cls == HandleFloodfillDatabaseLookupMessageJob.class)
return true;
}
@ -475,6 +477,11 @@ public class JobQueue {
//if ( (timeToWait <= 0) || (timeLeft < timeToWait) )
// _timedJobs is now a TreeSet, so once we hit one that is
// not ready yet, we can break
// NOTE: By not going through the whole thing, a single job changing
// setStartAfter() to some far-away time, without
// calling addJob(), could clog the whole queue forever.
// Hopefully nobody does that, and as a backup, we hope
// that the TreeSet will eventually resort it from other addJob() calls.
timeToWait = timeLeft;
break;
}
@ -654,7 +661,7 @@ public class JobQueue {
* @since 0.8.9
*/
public int getJobs(Collection<Job> readyJobs, Collection<Job> timedJobs,
Collection<Job> activeJobs, Collection<Job> justFinishedJobs) {
Collection<Job> activeJobs, Collection<Job> justFinishedJobs) {
for (JobQueueRunner runner :_queueRunners.values()) {
Job job = runner.getCurrentJob();
if (job != null) {

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 15;
public final static long BUILD = 16;
/** for example "-test" */
public final static String EXTRA = "";

View File

@ -10,7 +10,7 @@ import net.i2p.router.tunnel.TunnelCreatorConfig;
import net.i2p.util.Log;
/**
*
* Data about a tunnel we created
*/
class PooledTunnelCreatorConfig extends TunnelCreatorConfig {
private TunnelPool _pool;
@ -28,7 +28,7 @@ class PooledTunnelCreatorConfig extends TunnelCreatorConfig {
super(ctx, length, isInbound, destination);
}
// calls TestJob
/** calls TestJob */
@Override
public void testSuccessful(int ms) {
if (_testJob != null)
@ -37,7 +37,7 @@ class PooledTunnelCreatorConfig extends TunnelCreatorConfig {
_live = true;
}
// called from TestJob
/** called from TestJob */
public void testJobSuccessful(int ms) {
super.testSuccessful(ms);
_live = true;