Author: toad
Date: 2009-04-09 18:01:36 +0000 (Thu, 09 Apr 2009)
New Revision: 26679
Modified:
trunk/freenet/src/freenet/node/NodeRestartJobsQueue.java
Log:
Detect null jobs (already removed) in addLateRestartDatabaseJobs
Modified: trunk/freenet/src/freenet/node/NodeRestartJobsQueue.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeRestartJobsQueue.java 2009-04-09 15:02:56 UTC (rev 26678)
+++ trunk/freenet/src/freenet/node/NodeRestartJobsQueue.java 2009-04-09 18:01:36 UTC (rev 26679)
@@ -2,6 +2,7 @@
import java.util.ArrayList;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Set;
import com.db4o.ObjectContainer;
@@ -159,7 +160,14 @@
container.activate(dbJobs[i], 1);
if(!dbJobs[i].isEmpty())
System.err.println("Adding "+dbJobs[i].size()+" restart jobs at priority "+i);
- for(DBJob job : dbJobs[i]) {
+ for(Iterator<DBJob> it = dbJobs[i].iterator();it.hasNext();) {
+ DBJob job = it.next();
+ if(job == null) {
+ Logger.error(this, "Late restart job removed without telling the NodeRestartJobsQueue on priority "+i+"!");
+ it.remove();
+ container.ext().store(dbJobs[i], 2);
+ continue;
+ }
container.activate(job, 1);
runner.queue(job, i, false);
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.