Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
Increase IODspatcher dumpQueue size to 2 to reduce risk of concurrent emergency dump, skip concurrent emergency merge dealing with/see http://mantis.tokeek.de/view.php?id=566
regerc60ccdfbcfa5
diff --git a/source/net/yacy/kelondro/rwi/IODispatcher.java b/source/net/yacy/kelondro/rwi/IODispatcher.javaindex b51d54bef..d8138b8a8 100644--- a/source/net/yacy/kelondro/rwi/IODispatcher.java+++ b/source/net/yacy/kelondro/rwi/IODispatcher.java@@ -130,9 +130,8 @@ public class IODispatcher extends Thread {} else {log.info("appended merge job of files " + f1.getName() + ", " + f2.getName() + " to " + newFile.getName());}- } catch (final Exception e) {+ } catch (final Exception e) { // because mergeQueue size is 1, IllegalStateException could happen frequently (serial execution ensured in run() )log.warn("Could not add merge job to queue: " + e.getMessage(), e);- array.mergeMount(f1, f2, factory, newFile, (int) Math.min(MemoryControl.available() / 3, this.writeBufferSize));} finally {this.controlQueue.release();}@@ -164,10 +163,8 @@ public class IODispatcher extends Thread {dumpJob.dump();} catch (final InterruptedException e) {log.severe("main run job was interrupted (1)", e);- ConcurrentLog.logException(e);} catch (final Throwable e) {log.severe("main run job had errors (1), dump to " + f + " failed.", e);- ConcurrentLog.logException(e);}continue loop;}@@ -183,14 +180,12 @@ public class IODispatcher extends Thread {mergeJob.merge();} catch (final InterruptedException e) {log.severe("main run job was interrupted (2)", e);- ConcurrentLog.logException(e);} catch (final Throwable e) {if (f2 == null) {log.severe("main run job had errors (2), dump to " + f + " failed. Input file is " + f1, e);} else {log.severe("main run job had errors (2), dump to " + f + " failed. Input files are " + f1 + " and " + f2, e);}- ConcurrentLog.logException(e);}continue loop;}@@ -201,16 +196,14 @@ public class IODispatcher extends Thread {break;}- log.severe("main loop in bad state, dumpQueue.size() = " + this.dumpQueue.size() + ", mergeQueue.size() = " + this.mergeQueue.size() + ", controlQueue.availablePermits() = " + this.controlQueue.availablePermits());+ log.severe("main loop in bad state, dumpQueue.size() = " + this.dumpQueue.size() + ", mergeQueue.size() = " + this.mergeQueue.size() + ", controlQueue.availablePermits() = " + this.controlQueue.availablePermits() + ", MemoryControl.shortStatus() = " + MemoryControl.shortStatus());assert false : "this process statt should not be reached"; // this should never happen} catch (final Throwable e) {log.severe("main run job failed (X)", e);- ConcurrentLog.logException(e);}log.info("loop terminated");} catch (final Throwable e) {log.severe("main run job failed (4)", e);- ConcurrentLog.logException(e);} finally {log.info("terminating run job");this.controlQueue = null;diff --git a/source/net/yacy/kelondro/rwi/IndexCell.java b/source/net/yacy/kelondro/rwi/IndexCell.javaindex 2a71decad..fde5f4b3a 100644--- a/source/net/yacy/kelondro/rwi/IndexCell.java+++ b/source/net/yacy/kelondro/rwi/IndexCell.java@@ -94,7 +94,7 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu) throws IOException {super(factory);- this.merger = new IODispatcher(1, 1, writeBufferSize);+ this.merger = new IODispatcher(2, 1, writeBufferSize);this.array = new ReferenceContainerArray<ReferenceType>(cellPath, prefix, factory, termOrder, termSize);this.ram = new ReferenceContainerCache<ReferenceType>(factory, termOrder, termSize);this.countCache = new ComparableARC<byte[], Integer>(1000, termOrder);