fix for peer ping problem (implemented a 3-time re-ping); cause for 'Connection reset' still unknown

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4095 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent e78098be9b
commit 4275727d69

@ -3,7 +3,7 @@ javacSource=1.4
javacTarget=1.4
# Release Configuration
releaseVersion=0.544
releaseVersion=0.545
releaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
proReleaseFile=yacy_pro_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
releaseFileParentDir=yacy

@ -106,7 +106,7 @@ public class MessageSend_p {
prop.put("mode_permission",0);
if (targetPeer != null) {
yacyCore.peerActions.peerDeparture(targetPeer);
yacyCore.peerActions.peerDeparture(targetPeer, "peer responded upon message send request: " + response);
}
} else {
prop.put("mode_permission",1);

@ -205,7 +205,7 @@ public class plasmaDHTTransfer extends Thread {
this.transferStatusMessage = "Transfer to peer " + this.seed.getName() + ":" + this.seed.hash + " failed:'" + error + "', Trying to reconnect ...";
// force disconnection of peer
yacyCore.peerActions.peerDeparture(this.seed);
yacyCore.peerActions.peerDeparture(this.seed, "DHT Transfer: " + this.transferStatusMessage);
this.log.logWarning(this.transferStatusMessage);
// calculate pause time

@ -2814,7 +2814,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
// check if we got contact to peer and the peer respondet
if ((page == null) || (page.get("delay") == null)) {
log.logInfo("CRAWL: REMOTE CRAWL TO PEER " + remoteSeed.getName() + " FAILED. CAUSE: unknown (URL=" + urlEntry.url().toString() + "). Removed peer.");
yacyCore.peerActions.peerDeparture(remoteSeed);
yacyCore.peerActions.peerDeparture(remoteSeed, "remote crawl to peer failed; peer answered unappropriate");
return false; // no response from peer, we will crawl this ourself
}

@ -97,7 +97,7 @@ public final class yacyClient {
HashMap result = null;
final serverObjects post = yacyNetwork.basicRequestPost(plasmaSwitchboard.getSwitchboard(), null);
try {
for (int retry = 0; retry < 3; retry++) try {
// generate request
post.putASIS("count", "20");
post.putASIS("seed", yacyCore.seedDB.mySeed.genSeedStr(post.get("key", "")));
@ -114,14 +114,18 @@ public final class yacyClient {
null
), "UTF-8"
);
break;
} catch (Exception e) {
if (Thread.currentThread().isInterrupted()) {
yacyCore.log.logFine("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "' interrupted.");
return -1;
} else {
yacyCore.log.logFine("yacyClient.publishMySeed exception:" + e.getMessage());
yacyCore.log.logFine("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "' exception: " + e.getMessage() + "; retry = " + retry); // here VERY OFTEN a 'Connection reset' appears. What is the cause?
// try again (go into loop)
}
return -1;
result = null;
}
if (result == null || result.size() < 3) {
yacyCore.log.logFine("yacyClient.publishMySeed result error: " +
((result == null) ? "result null" : ("result=" + result.toString())));
@ -400,7 +404,7 @@ public final class yacyClient {
);
} catch (IOException e) {
yacyCore.log.logFine("SEARCH failed FROM " + target.hash + ":" + target.getName() + " (" + e.getMessage() + "), score=" + target.selectscore + ", DHTdist=" + yacyDHTAction.dhtDistance(target.hash, wordhashes.substring(0, 12)));
yacyCore.peerActions.peerDeparture(target);
yacyCore.peerActions.peerDeparture(target, "search request to peer created io exception: " + e.getMessage());
return null;
}

@ -316,8 +316,9 @@ public class yacyCore {
this.added = yacyClient.publishMySeed(seed.getClusterAddress(), seed.hash);
if (this.added < 0) {
// no or wrong response, delete that address
log.logInfo("publish: disconnected " + this.seed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR) + " peer '" + this.seed.getName() + "' from " + this.seed.getPublicAddress());
peerActions.peerDeparture(this.seed);
String cause = "peer ping to peer resulted in error response (added < 0)";
log.logInfo("publish: disconnected " + this.seed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR) + " peer '" + this.seed.getName() + "' from " + this.seed.getPublicAddress() + ": " + cause);
peerActions.peerDeparture(this.seed, cause);
} else {
// success! we have published our peer to a senior peer
// update latest news from the other peer
@ -442,9 +443,10 @@ public class yacyCore {
final String address = seed.getClusterAddress();
log.logFine("HELLO #" + i + " to peer '" + seed.get(yacySeed.NAME, "") + "' at " + address); // debug
if ((address == null) || (seed.isProper() != null)) {
String seederror = seed.isProper();
if ((address == null) || (seederror != null)) {
// we don't like that address, delete it
peerActions.peerDeparture(seed);
peerActions.peerDeparture(seed, "peer ping to peer resulted in address = " + address + "; seederror = " + seederror);
sync.P();
} else {
// starting a new publisher thread
@ -485,8 +487,9 @@ public class yacyCore {
if (seed != null) {
String address = seed.getPublicAddress();
log.logFine("HELLO x" + contactedSeedCount + " to peer '" + seed.get(yacySeed.NAME, "") + "' at " + address); // debug
if ((address == null) || (seed.isProper() != null)) {
peerActions.peerDeparture(seed);
String seederror = seed.isProper();
if ((address == null) || (seederror != null)) {
peerActions.peerDeparture(seed, "initial peer ping to peer resulted in address = " + address + "; seederror = " + seederror);
} else {
if (seed.alternativeIP != null) address = seed.alternativeIP + ":" + seed.getPort();
contactedSeedCount++;
@ -495,7 +498,7 @@ public class yacyCore {
newSeeds = yacyClient.publishMySeed(address, seed.hash);
if (newSeeds < 0) {
log.logInfo("publish: disconnected " + seed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR) + " peer '" + seed.getName() + "' from " + seed.getPublicAddress());
peerActions.peerDeparture(seed);
peerActions.peerDeparture(seed, "initial peer ping to peer resulted in seed response < 0");
} else {
log.logInfo("publish: handshaked " + seed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR) + " peer '" + seed.getName() + "' at " + seed.getPublicAddress());
}

@ -351,9 +351,9 @@ public class yacyPeerActions {
}
}
private final void disconnectPeer(yacySeed seed) {
private final void disconnectPeer(yacySeed seed, String cause) {
// we do this if we did not get contact with the other peer
yacyCore.log.logFine("connect: no contact to a " + seed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_VIRGIN) + " peer '" + seed.getName() + "' at " + seed.getPublicAddress());
yacyCore.log.logFine("connect: no contact to a " + seed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_VIRGIN) + " peer '" + seed.getName() + "' at " + seed.getPublicAddress() + ". Cause: " + cause);
synchronized (seedDB) {
if (!seedDB.hasDisconnected(seed.hash)) { disconnects++; }
seed.put("dct", Long.toString(System.currentTimeMillis()));
@ -372,10 +372,9 @@ public class yacyPeerActions {
return res;
}
public void peerDeparture(yacySeed peer) {
public void peerDeparture(yacySeed peer, String cause) {
if (peer == null) return;
//System.out.println("PEER DEPARTURE:" + peer.toString());
disconnectPeer(peer);
disconnectPeer(peer, cause);
// perform all actions
Iterator i = actions.iterator();
while (i.hasNext()) ((yacyPeerAction) i.next()).processPeerDeparture(peer);

@ -60,13 +60,11 @@ network.unit.bootstrap.seedlist2 = http://low.audioattack.de/yacy/seed.txt
network.unit.bootstrap.seedlist3 = http://www.lulabad.de/seed.txt
network.unit.bootstrap.seedlist4 = http://www.yacy.net/seed.txt
network.unit.bootstrap.seedlist5 = http://www.marcelhenseler.de/yacy/seed.txt
network.unit.bootstrap.seedlist6 = http://www.dc-art.de/yacy/seed.txt
# each network may use different yacy distributions.
# the auto-updater can access network-specific update locations
network.unit.update.location0 = http://yacy.net/Download.html
network.unit.update.location1 = http://latest.yacy.net
network.unit.update.location2 = http://www.findenstattsuchen.info/YaCy/latest/index.php
network.unit.update.location1 = http://latest.yacy.de
# properties for in-protocol response authentification:
network.unit.protocol.control = uncontrolled

Loading…
Cancel
Save