- fixes for concurrency exceptions and failed database integrity verification

- added link to yacystats peer when peer is more than one day old

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7164 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 29fe401f93
commit 37baa8bae3

@ -174,7 +174,6 @@ httpdMaxBusySessions = 200
# users shall be encouraged to use the htdocs path for individual content,
# not this path defined here
htRootPath = htroot
htTemplatePath = htroot/env/templates
# the htroot path
# root path for the httpd file server

@ -29,12 +29,11 @@ import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TreeSet;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.text.SimpleDateFormat;
import net.yacy.cora.protocol.Domains;
@ -55,7 +54,7 @@ public class AccessTracker_p {
private static SimpleDateFormat SimpleFormatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US);
private static final Collection<Track> listclone(final Collection<Track> m) {
final List<Track> accessClone = new LinkedList<Track>();
final Collection<Track> accessClone = new ConcurrentLinkedQueue<Track>();
try {
accessClone.addAll(m);
} catch (final ConcurrentModificationException e) {}

@ -197,8 +197,8 @@ public class CrawlResults {
urlstr = metadata.url().toNormalform(false, true);
urltxt = nxTools.shortenURLString(urlstr, 72); // shorten the string text like a URL
}
initiatorSeed = entry.getValue() == null ? null : sb.peers.getConnected(new String(entry.getValue().initiatorHash));
executorSeed = entry.getValue() == null ? null : sb.peers.getConnected(new String(entry.getValue().executorHash));
initiatorSeed = entry.getValue() == null || entry.getValue().initiatorHash == null ? null : sb.peers.getConnected(new String(entry.getValue().initiatorHash));
executorSeed = entry.getValue() == null || entry.getValue().executorHash == null ? null : sb.peers.getConnected(new String(entry.getValue().executorHash));
prop.put("table_indexed_" + cnt + "_dark", (dark) ? "1" : "0");
prop.put("table_indexed_" + cnt + "_feedbackpage", "CrawlResults.html");

@ -99,7 +99,7 @@
<li><a href="http://forum.yacy.de" class="MenuItemLink">Deutsches Forum</a></li>
<li><a href="http://www.yacy-forum.org" class="MenuItemLink">English Forum</a></li>
<li><a href="http://wiki.yacy.de" class="MenuItemLink">YaCy Project Wiki</a></li>
<li><a href="http://www.yacystats.de" class="MenuItemLink">YaCy Statistics</a></li>
<li><a href="#(newpeer)#http://www.yacystats.de/peer/#[peerhash]#::http://www.yacystats.de#(/newpeer)#" class="MenuItemLink">#(newpeer)#Peer Statistics::YaCy Statistics#(/newpeer)#</a></li>
</ul>
</li>
</ul>

@ -6,10 +6,10 @@
</head>
<body id="error">
<div class="head">
<h1 class="head">YaCy - Distributed Web Indexing - Administration</h1>
<h3 class="head">YaCy</h3>
</div>
<div class="content">
<h2>Problems with request: <span class="settingsValue">#[requestMethod]# #[requestURL]#</span></h2>
<p>request: <span class="settingsValue">#[requestMethod]# #[requestURL]#</span></p>
<p class="tt">#[httpStatus]#</p>
#(errorMessageType)#
<!-- 0 --><p><strong>unspecified error</strong></p>

@ -104,6 +104,7 @@ import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.server.servletProperties;
import de.anomic.yacy.yacyBuildProperties;
import de.anomic.yacy.yacySeed;
import de.anomic.yacy.graphics.EncodedImage;
public final class HTTPDFileHandler {
@ -117,7 +118,6 @@ public final class HTTPDFileHandler {
private static File htRootPath = null;
private static File htDocsPath = null;
private static File htTemplatePath = null;
private static String[] defaultFiles = null;
private static File htDefaultPath = null;
private static File htLocalePath = null;
@ -170,14 +170,6 @@ public final class HTTPDFileHandler {
final File repository = new File(htDocsPath, "repository");
if (!repository.exists()) repository.mkdirs();
// create a htTemplatePath
if (htTemplatePath == null) {
htTemplatePath = theSwitchboard.getAppPath("htTemplatePath","htroot/env/templates");
if (!(htTemplatePath.exists())) htTemplatePath.mkdir();
}
//This is now handles by #%env/templates/foo%#
//if (templates.isEmpty()) templates.putAll(httpTemplate.loadTemplates(htTemplatePath));
// create htLocaleDefault, htLocalePath
if (htDefaultPath == null) htDefaultPath = theSwitchboard.getAppPath("htDefaultPath", "htroot");
if (htLocalePath == null) htLocalePath = theSwitchboard.getDataPath("locale.translated_html", "DATA/LOCALE/htroot");
@ -818,6 +810,9 @@ public final class HTTPDFileHandler {
templatePatterns.putHTML(servletProperties.PEER_STAT_CLIENTNAME, switchboard.getConfig("peerName", "anomic"));
templatePatterns.putHTML(servletProperties.PEER_STAT_CLIENTID, ((Switchboard) switchboard).peers.myID());
templatePatterns.put(servletProperties.PEER_STAT_MYTIME, DateFormatter.formatShortSecond());
yacySeed myPeer = sb.peers.mySeed();
templatePatterns.put("newpeer", myPeer.getAge() >= 1 ? 0 : 1);
templatePatterns.putHTML("newpeer_peerhash", myPeer.hash);
//System.out.println("respond props: " + ((tp == null) ? "null" : tp.toString())); // debug
} catch (final InvocationTargetException e) {
if (e.getCause() instanceof InterruptedException) {

@ -155,7 +155,9 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
try { Thread.sleep(100); } catch (final InterruptedException ex) {}
// trying to interrupt session
s.notify();
synchronized (s) {
s.notify();
}
s.interrupt();
try {Thread.sleep(10);} catch (final InterruptedException ex) {}

@ -406,7 +406,12 @@ public class HeapReader {
// access the file and read the container
file.seek(pos);
final int len = file.readInt() - index.row().primaryKeyLength;
if (len < 0) throw new IOException("file " + file.file() + " corrupted at " + pos + ": negative len. len = " + len + ", pk.len = " + index.row().primaryKeyLength);
if (len < 0) {
// database file may be corrupted and should be deleted :-((
Log.logSevere("HeapReader", "file " + file.file() + " corrupted at " + pos + ": negative len. len = " + len + ", pk.len = " + index.row().primaryKeyLength);
// to get lazy over that problem (who wants to tell the user to stop operation and delete the file???) we work on like the entry does not exist
return null;
}
if (MemoryControl.available() < len * 2 + keepFreeMem) {
if (!MemoryControl.request(len * 2 + keepFreeMem, true)) throw new RowSpaceExceededException(len * 2 + keepFreeMem, "HeapReader.get()"); // not enough memory available for this blob
}

Loading…
Cancel
Save