Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- remove superfluous entries in remote search tracker handles - avoid concurrent access from same client this is a fix for http://forum.yacy-websuche.de/viewtopic.php?p=20045#p20045
orbiter586bc4d920b7
diff --git a/htroot/yacy/search.java b/htroot/yacy/search.javaindex 841b2a95b..14a99ede5 100644--- a/htroot/yacy/search.java+++ b/htroot/yacy/search.java@@ -146,14 +146,16 @@ public final class search {TreeSet<Long> trackerHandles = sb.remoteSearchTracker.get(client);if (trackerHandles == null) trackerHandles = new TreeSet<Long>();boolean block = false;- if (trackerHandles.tailSet(Long.valueOf(System.currentTimeMillis() - 3000)).size() > 1) {- block = true;- }- if (trackerHandles.tailSet(Long.valueOf(System.currentTimeMillis() - 60000)).size() > 12) {- block = true;- }- if (trackerHandles.tailSet(Long.valueOf(System.currentTimeMillis() - 600000)).size() > 36) {- block = true;+ synchronized (trackerHandles) {+ if (trackerHandles.tailSet(Long.valueOf(System.currentTimeMillis() - 3000)).size() > 1) {+ block = true;+ }+ if (trackerHandles.tailSet(Long.valueOf(System.currentTimeMillis() - 60000)).size() > 12) {+ block = true;+ }+ if (trackerHandles.tailSet(Long.valueOf(System.currentTimeMillis() - 600000)).size() > 36) {+ block = true;+ }}if (block) {prop.put("links", "");@@ -386,10 +388,13 @@ public final class search {sb.remoteSearches.add(theQuery);// update the search tracker- trackerHandles.add(theQuery.handle);+ synchronized (trackerHandles) {+ trackerHandles.add(theQuery.handle); // thats the time when the handle was created+ // we don't need too much entries in the list; remove superfluous+ while (trackerHandles.size() > 36) if (!trackerHandles.remove(trackerHandles.first())) break;+ }sb.remoteSearchTracker.put(client, trackerHandles);-// logyacyCore.log.logInfo("EXIT HASH SEARCH: " +QueryParams.anonymizedQueryHashes(theQuery.queryHashes) + " - " + joincount + " links found, " +