Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- fix for ConcurrentModificationException during shutdown - fix for Ranking distribution problem (suma-lab peer does not exist any more)
orbiter75a17021332e
diff --git a/defaults/yacy.init b/defaults/yacy.initindex f8c4d3b76..26b1860a7 100644--- a/defaults/yacy.init+++ b/defaults/yacy.init@@ -727,7 +727,7 @@ indexDistribution.dhtReceiptLimit = 10000# Distribution of Citation-Reference (CR-) files# The distribution is done in two steps:# first step to anonymize the records-# second step to forward to collecting peer+# second step to forward to a collecting peer# to anonymize the data even against the intermediate peer# a specific precentage is also sent again to other peers.# for key-numbers please see de.anomic.plasma.plasmaRankingDistribution@@ -739,7 +739,7 @@ CRDist0Target =CRDist1Path = GLOBAL/014_othercrCRDist1Method = 9CRDist1Percent = 30-CRDist1Target = kaskelix.de:8080,yacy.dyndns.org:8000,suma-lab.de:8080+CRDist1Target = kaskelix.de:8080,yacy.dyndns.org:8000# Search sequence settings# collection:diff --git a/source/de/anomic/server/serverCore.java b/source/de/anomic/server/serverCore.javaindex 81124a204..d7b2b88ca 100644--- a/source/de/anomic/server/serverCore.java+++ b/source/de/anomic/server/serverCore.java@@ -66,8 +66,7 @@ import java.security.KeyStore;import java.util.ConcurrentModificationException;import java.util.Enumeration;import java.util.HashMap;-import java.util.HashSet;-import java.util.Iterator;+import java.util.concurrent.ConcurrentHashMap;import javax.net.ssl.HandshakeCompletedEvent;import javax.net.ssl.HandshakeCompletedListener;@@ -120,6 +119,10 @@ public final class serverCore extends serverAbstractBusyThread implements server// static variablespublic static final Boolean TERMINATE_CONNECTION = Boolean.FALSE;public static final Boolean RESUME_CONNECTION = Boolean.TRUE;++ // Dummy value Object to use ConcurrentHashMap as HashSet+ private static final Object PRESENT = new Object();+/*** for brute-force prevention*/@@ -152,7 +155,7 @@ public final class serverCore extends serverAbstractBusyThread implements serverHashMap<String, String> denyHost;int commandMaxLength;private int maxBusySessions;- HashSet<Session> busySessions;+ ConcurrentHashMap<Session, Object> busySessions;/*private static ServerSocketFactory getServerSocketFactory(boolean dflt, File keyfile, String passphrase) {@@ -226,7 +229,7 @@ public final class serverCore extends serverAbstractBusyThread implements server// init session parametermaxBusySessions = Integer.valueOf(switchboard.getConfig("httpdMaxBusySessions","100")).intValue();- busySessions = new HashSet<Session>();+ busySessions = new ConcurrentHashMap<Session, Object>();// init servercoreinit();@@ -459,7 +462,7 @@ public final class serverCore extends serverAbstractBusyThread implements server// create sessionSession connection = new Session(sessionThreadGroup, controlSocket, this.timeout);- this.busySessions.add(connection);+ this.busySessions.put(connection, PRESENT);} else {this.log.logWarning("ACCESS FROM " + cIP + " DENIED");}@@ -481,7 +484,7 @@ public final class serverCore extends serverAbstractBusyThread implements serverThread.interrupted();// shut down all busySessions- if (this.busySessions != null) for (Session session: this.busySessions) {+ if (this.busySessions != null) for (Session session: this.busySessions.keySet()) {try {session.interrupt();} catch (SecurityException e ) {@@ -513,10 +516,7 @@ public final class serverCore extends serverAbstractBusyThread implements server// close all sessionsthis.log.logInfo("Closing server sessions ...");- Iterator<Session> i = this.busySessions.iterator();- Session s;- while (i.hasNext()) {- s = i.next();+ for (Session s: this.busySessions.keySet()) {s.interrupt();s.close();}