Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
Let auto-disabled crawls recover if low resource condition vanished. Analog to autodisabled DHT switch autodisabled crawls back on upon mem ok by remembering the autodisable by conf parameter.
reger42b0672be380
diff --git a/pom.xml b/pom.xmlindex 38f4c89ea..2b72c8055 100644--- a/pom.xml+++ b/pom.xml@@ -4,7 +4,7 @@<groupId>net.yacy</groupId><artifactId>yacycore</artifactId>- <version>1.81</version>+ <version>1.83</version><packaging>jar</packaging><description>YaCy - a Peer to Peer Web Search Engine</description><name>YaCy</name>diff --git a/source/net/yacy/search/ResourceObserver.java b/source/net/yacy/search/ResourceObserver.javaindex 62cd170e7..df0daa4e1 100644--- a/source/net/yacy/search/ResourceObserver.java+++ b/source/net/yacy/search/ResourceObserver.java@@ -92,10 +92,12 @@ public class ResourceObserver {if (!this.sb.crawlJobIsPaused(SwitchboardConstants.CRAWLJOB_LOCAL_CRAWL)) {log.info("pausing local crawls");this.sb.pauseCrawlJob(SwitchboardConstants.CRAWLJOB_LOCAL_CRAWL, "resource observer:" + reason);+ this.sb.setConfig(SwitchboardConstants.CRAWLJOB_LOCAL_AUTODISABLED,true);}if (!this.sb.crawlJobIsPaused(SwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL)) {log.info("pausing remote triggered crawls");this.sb.pauseCrawlJob(SwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL, "resource observer:" + reason);+ this.sb.setConfig(SwitchboardConstants.CRAWLJOB_REMOTE_AUTODISABLED,true);}if ((this.normalizedDiskFree == Space.EXHAUSTED || this.normalizedMemoryFree != Space.AMPLE) && this.sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, false)) {@@ -220,6 +222,14 @@ public class ResourceObserver {this.sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW, true);this.sb.peers.mySeed().setFlagAcceptRemoteIndex(true);this.sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, false);+ } else if (this.sb.getConfigBool(SwitchboardConstants.CRAWLJOB_LOCAL_AUTODISABLED, false)) {+ log.info("continue paused local crawls");+ this.sb.setConfig(SwitchboardConstants.CRAWLJOB_LOCAL_AUTODISABLED,false);+ this.sb.continueCrawlJob(SwitchboardConstants.CRAWLJOB_LOCAL_CRAWL);+ } else if (this.sb.getConfigBool(SwitchboardConstants.CRAWLJOB_REMOTE_AUTODISABLED, false)) {+ log.info("continue paused remote triggered crawls");+ this.sb.setConfig(SwitchboardConstants.CRAWLJOB_REMOTE_AUTODISABLED,false);+ this.sb.continueCrawlJob(SwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL);}log.info("resources ok");}diff --git a/source/net/yacy/search/SwitchboardConstants.java b/source/net/yacy/search/SwitchboardConstants.javaindex df2c66e4c..03e32c9c5 100644--- a/source/net/yacy/search/SwitchboardConstants.java+++ b/source/net/yacy/search/SwitchboardConstants.java@@ -475,7 +475,9 @@ public final class SwitchboardConstants {public static final String RESOURCE_DISK_USED_MAX_OVERSHOT = "resource.disk.used.max.overshot";public static final String MEMORY_ACCEPTDHT = "memory.acceptDHTabove";- public static final String INDEX_RECEIVE_AUTODISABLED = "memory.disabledDHT";+ public static final String INDEX_RECEIVE_AUTODISABLED = "memory.disabledDHT"; // set if DHT was disabled by ResourceObserver+ public static final String CRAWLJOB_LOCAL_AUTODISABLED = "memory.disabledLocalCrawler"; // set if local crawl was disabled by ResourceObserver+ public static final String CRAWLJOB_REMOTE_AUTODISABLED = "memory.disabledRemoteCrawler"; // set if remote crawl was disabled by ResourceObserver/** Some constants