Skip to content

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

fix for synchronization deadlock with flushMissNameCache. see also: http://www.yacy-forum.de/viewtopic.php?p=32939#32939

orbiter5b0a84ce0955
diff --git a/source/de/anomic/http/httpc.java b/source/de/anomic/http/httpc.java
index abf5ca9ea..ff761b815 100644
--- a/source/de/anomic/http/httpc.java
+++ b/source/de/anomic/http/httpc.java
@@ -557,7 +557,7 @@ public final class httpc {
int cutofftime = intTime(System.currentTimeMillis()) - maxNameCacheMissAge;
int size;
String k;
- synchronized (nameCacheMiss) {
+ synchronized (nameCacheMissAges) {
size = nameCacheMissAges.size();
while ((size > 0) &&
(size > maxNameCacheMissSize) || (nameCacheMissAges.getMinScore() < cutofftime)) {
diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java
index c098c4bbf..e9a8c444a 100644
--- a/source/de/anomic/plasma/plasmaSwitchboard.java
+++ b/source/de/anomic/plasma/plasmaSwitchboard.java
@@ -2919,6 +2919,30 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
return false;
}
+ public void setPerformance(int wantedPPM) {
+ // we consider 3 cases here
+ // wantedPPM <= 10: low performance
+ // 10 < wantedPPM < 1000: custom performance
+ // 1000 <= wantedPPM : maximum performance
+ if (wantedPPM <= 10) wantedPPM = 10;
+ if (wantedPPM >= 1000) wantedPPM = 1000;
+ int newBusySleep = 60000 / wantedPPM;
+
+ serverThread CRAWLSTACK_thread = getThread(CRAWLSTACK);
+ serverThread INDEXER_thread = getThread(INDEXER);
+ serverThread PROXY_CACHE_ENQUEUE_thread = getThread(PROXY_CACHE_ENQUEUE);
+ serverThread CRAWLJOB_REMOTE_TRIGGERED_CRAWL_thread = getThread(CRAWLJOB_REMOTE_TRIGGERED_CRAWL);
+ serverThread CRAWLJOB_GLOBAL_CRAWL_TRIGGER_thread = getThread(CRAWLJOB_GLOBAL_CRAWL_TRIGGER);
+ serverThread CRAWLJOB_LOCAL_CRAWL_thread = getThread(CRAWLJOB_LOCAL_CRAWL);
+ serverThread INDEX_DIST_thread = getThread(INDEX_DIST);
+
+
+ CRAWLJOB_LOCAL_CRAWL_thread.setBusySleep(newBusySleep);
+
+
+ setConfig(CRAWLJOB_LOCAL_CRAWL, Long.toString(newBusySleep));
+ }
+
public void startTransferWholeIndex(yacySeed seed, boolean delete) {
if (transferIdxThread == null) {
this.transferIdxThread = new plasmaDHTFlush(this.log, this.wordIndex, seed, delete,