Skip to content

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

log a error on aborted news publish (due to duplicate news.id) + change printed err msg to log entry in PeerAction.processPeerArrival

regerebf818ad9597
diff --git a/htroot/TransNews_p.java b/htroot/TransNews_p.java
index d570cf363..98c432afd 100644
--- a/htroot/TransNews_p.java
+++ b/htroot/TransNews_p.java
@@ -169,8 +169,8 @@ public class TransNews_p {
final HashMap<String, Integer> positiveHashes = new HashMap<String, Integer>(); // a mapping from an url hash to Integer (count of votes)
accumulateVotes(sb, negativeHashes, positiveHashes, NewsPool.INCOMING_DB);
final ScoreMap<String> ranking = new ConcurrentScoreMap<String>(); // score cluster for url hashes
- final HashMap<String, NewsDB.Record> Translation = new HashMap<String, NewsDB.Record>(); // a mapping from an url hash to a kelondroRow.Entry with display properties
- accumulateTranslations(sb, Translation, ranking, negativeHashes, positiveHashes, NewsPool.INCOMING_DB);
+ final HashMap<String, NewsDB.Record> translation = new HashMap<String, NewsDB.Record>(); // a mapping from an url hash to a kelondroRow.Entry with display properties
+ accumulateTranslations(sb, translation, ranking, negativeHashes, positiveHashes, NewsPool.INCOMING_DB);
// read out translation-news array and create property entries
final Iterator<String> k = ranking.keys(false);
@@ -187,7 +187,7 @@ public class TransNews_p {
continue;
}
- row = Translation.get(refid);
+ row = translation.get(refid);
if (row == null) {
continue;
}
diff --git a/source/net/yacy/peers/NewsPool.java b/source/net/yacy/peers/NewsPool.java
index 1f13232f8..a16a8bcce 100644
--- a/source/net/yacy/peers/NewsPool.java
+++ b/source/net/yacy/peers/NewsPool.java
@@ -325,6 +325,8 @@ public class NewsPool {
if (this.newsDB.get(record.id()) == null) {
this.incomingNews.push(record); // we want to see our own news..
this.outgoingNews.push(record); // .. and put it on the publishing list
+ } else {
+ ConcurrentLog.info("NewsPool", "publishing of news aborted, news with same id (time + originator) exists id=" + record.id());
}
} catch (final Exception e) {
ConcurrentLog.logException(e);
diff --git a/source/net/yacy/peers/PeerActions.java b/source/net/yacy/peers/PeerActions.java
index b249d5c95..46bb263aa 100644
--- a/source/net/yacy/peers/PeerActions.java
+++ b/source/net/yacy/peers/PeerActions.java
@@ -30,7 +30,6 @@ import net.yacy.cora.document.encoding.ASCII;
import net.yacy.cora.document.feed.RSSMessage;
import net.yacy.cora.storage.ConcurrentARC;
import net.yacy.kelondro.util.MapTools;
-import net.yacy.peers.operation.yacyVersion;
public class PeerActions {
@@ -261,7 +260,7 @@ public class PeerActions {
final String cre1 = MapTools.string2map(decodedString, ",").get("cre");
final String cre2 = MapTools.string2map(record.toString(), ",").get("cre");
if ((cre1 == null) || (cre2 == null) || (!(cre1.equals(cre2)))) {
- System.out.println("### ERROR - cre are not equal: cre1=" + cre1 + ", cre2=" + cre2);
+ Network.log.warn("processPeerArrival: ### ERROR - message creation date verification not equal: cre1=" + cre1 + ", cre2=" + cre2);
return;
}
try {