Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix for deadlock when initializing a SplitTable with a file of size 0, see also: http://forum.yacy-websuche.de/viewtopic.php?p=18594#p18594

orbiter4f1f4863c4ce
diff --git a/source/net/yacy/kelondro/table/SplitTable.java b/source/net/yacy/kelondro/table/SplitTable.java
index f10b0a49a..37258c930 100644
--- a/source/net/yacy/kelondro/table/SplitTable.java
+++ b/source/net/yacy/kelondro/table/SplitTable.java
@@ -191,7 +191,7 @@ public class SplitTable implements ObjectIndex, Iterable<Row.Entry> {
while (i.hasNext()) {
entry = i.next();
ram = entry.getValue().longValue();
- if (ram > maxram) {
+ if (maxf == null || ram > maxram) {
maxf = entry.getKey();
maxram = ram;
}
@@ -199,16 +199,14 @@ public class SplitTable implements ObjectIndex, Iterable<Row.Entry> {
// open next biggest table
t.remove(maxf);
- if (maxf != null) {
- f = new File(path, maxf);
- Log.logInfo("kelondroSplitTable", "opening partial eco table " + f);
- try {
- table = new Table(f, rowdef, EcoFSBufferSize, 0, this.useTailCache, this.exceed134217727);
- } catch (RowSpaceExceededException e) {
- table = new Table(f, rowdef, 0, 0, false, this.exceed134217727);
- }
- tables.put(maxf, table);
+ f = new File(path, maxf);
+ Log.logInfo("kelondroSplitTable", "opening partial eco table " + f);
+ try {
+ table = new Table(f, rowdef, EcoFSBufferSize, 0, this.useTailCache, this.exceed134217727);
+ } catch (RowSpaceExceededException e) {
+ table = new Table(f, rowdef, 0, 0, false, this.exceed134217727);
}
+ tables.put(maxf, table);
}
// init the thread pool for the keeperOf executor service