added a catch Exception to all thread to check if any of them silently dies without any other notification

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5922 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 083533e5ec
commit c097531e3d

@ -533,6 +533,7 @@ final class memprofiler extends Thread {
}
public void run() {
try {
int seconds0 = 0, kilobytes0 = 0;
int seconds1 = 0, kilobytes1 = 0;
while (run) {
@ -544,9 +545,16 @@ final class memprofiler extends Thread {
kilobytes0 = kilobytes1;
try {Thread.sleep(100);} catch (final InterruptedException e) {}
}
} catch (final Exception e) {
e.printStackTrace();
}
try {
ImageIO.write(memChart.getImage(), "png", outputFile);
} catch (final IOException e) {}
} catch (final IOException e) {
// do noting
} catch (final Exception e) {
e.printStackTrace();
}
}
public void terminate() {

@ -87,6 +87,7 @@ public class URLAnalysis {
}
public void run() {
try {
yacyURL url;
Pattern p = Pattern.compile("~|\\(|\\)|\\+|-|@|:|%|\\.|;|_");
while (true) {
@ -99,6 +100,9 @@ public class URLAnalysis {
e.printStackTrace();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
private void update(String[] s) {

@ -1332,7 +1332,11 @@ public final class httpdProxyHandler {
) {
out.write(buffer, 0, len);
}
} catch (final IOException e) {}
} catch (final IOException e) {
// do nothing
} catch (Exception e) {
e.printStackTrace();
}
}
public void pleaseTerminate() {

@ -41,7 +41,7 @@ import de.anomic.kelondro.order.ByteOrder;
import de.anomic.kelondro.order.CloneableIterator;
import de.anomic.kelondro.util.ByteArray;
public class BLOBCompressor extends Thread implements BLOB {
public class BLOBCompressor implements BLOB {
static byte[] gzipMagic = {(byte) 'z', (byte) '|'}; // magic for gzip-encoded content
static byte[] plainMagic = {(byte) 'p', (byte) '|'}; // magic for plain content (no encoding)

@ -377,6 +377,9 @@ public final class MetadataRepository implements Iterable<byte[]> {
} catch (final IOException e) {
e.printStackTrace();
run = false;
} catch (final Exception e) {
e.printStackTrace();
run = false;
}
Log.logInfo("URLDBCLEANER", "UrldbCleaner-Thread stopped");
}
@ -512,6 +515,9 @@ public final class MetadataRepository implements Iterable<byte[]> {
} catch (final IOException e) {
e.printStackTrace();
this.failure = e.getMessage();
} catch (final Exception e) {
e.printStackTrace();
this.failure = e.getMessage();
}
// terminate process
}

@ -191,6 +191,7 @@ public class ReferenceOrder {
int p = this.start;
String dom;
Integer count;
try {
while (p < this.end) {
iEntry = new WordReferenceVars(new WordReferenceRow(container.get(p++, false)));
this.decodedEntries.add(iEntry);
@ -206,6 +207,9 @@ public class ReferenceOrder {
doms.put(dom, Integer.valueOf(count.intValue() + 1));
}
}
} catch (final Exception e) {
e.printStackTrace();
}
}
public ArrayList<WordReferenceVars> decodedContainer() {

@ -228,7 +228,11 @@ public final class plasmaSearchEvent {
// sort the local containers and truncate it to a limited count,
// so following sortings together with the global results will be fast
try {
rankedCache.execQuery();
} catch (final Exception e) {
e.printStackTrace();
}
}
}
@ -508,6 +512,7 @@ public final class plasmaSearchEvent {
// start fetching urls and snippets
URLMetadataRow page;
final int fetchAhead = snippetMode == 0 ? 0 : 10;
try {
while (System.currentTimeMillis() < this.timeout) {
this.lastLifeSign = System.currentTimeMillis();
@ -542,6 +547,9 @@ public final class plasmaSearchEvent {
}
//System.out.println("DEBUG SNIPPET_LOADING: thread " + id + " got " + resultEntry.url());
}
} catch (final Exception e) {
e.printStackTrace();
}
Log.logInfo("SEARCH", "resultWorker thread " + id + " terminated");
}

@ -2238,6 +2238,8 @@ class delayedShutdown extends Thread {
Thread.sleep(delay);
} catch (final InterruptedException e) {
sb.getLog().logInfo("interrupted delayed shutdown");
} catch (final Exception e) {
e.printStackTrace();
}
this.sb.terminate();
}

@ -706,7 +706,9 @@ public final class plasmaWordIndex {
}
}
}
} catch (IOException e) {
} catch (final IOException e) {
e.printStackTrace();
} catch (final Exception e) {
e.printStackTrace();
}
Log.logInfo("INDEXCLEANER", "IndexCleaner-Thread stopped");

@ -620,6 +620,8 @@ public final class serverCore extends serverAbstractBusyThread implements server
listen();
} catch (final IOException e) {
System.err.println("ERROR: (internal) " + e);
} catch (final Exception e) {
e.printStackTrace();
} finally {
try {
if ((this.controlSocket != null) && (! this.controlSocket.isClosed())) {
@ -925,7 +927,8 @@ public final class serverCore extends serverAbstractBusyThread implements server
try {
Thread.sleep(delay);
} catch (final InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (final Exception e) {
e.printStackTrace();
}

@ -57,6 +57,7 @@ public class serverProfiling extends Thread {
}
public void run() {
try {
while (running) {
update("memory", Long.valueOf(MemoryControl.used()), true);
try {
@ -65,6 +66,9 @@ public class serverProfiling extends Thread {
this.running = false;
}
}
} catch (final Exception e) {
e.printStackTrace();
}
}
public static void update(final String eventName, final Object eventPayload, boolean useProtection) {

@ -73,7 +73,11 @@ public class consoleInterface extends Thread
output.add(line);
}
dataIsRead.release();
} catch(final IOException ix) { log.logWarning("logpoint 6 " + ix.getMessage());}
} catch (final IOException ix) {
log.logWarning("logpoint 6 " + ix.getMessage());
} catch (final Exception e) {
e.printStackTrace();
}
}
/**

@ -107,7 +107,9 @@ public class mediawikiIndex {
public void run() {
try {
createIndex(this.wikimediaxml);
} catch (IOException e) {
} catch (final IOException e) {
} catch (final Exception e) {
e.printStackTrace();
}
}
}

@ -29,7 +29,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UTFDataFormatException;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

@ -113,6 +113,7 @@ public class yacySearch extends Thread {
}
public void run() {
try {
this.urls = yacyClient.search(
wordIndex.peers().mySeed(),
wordhashes, excludehashes, urlhashes, prefer, filter, language, count, maxDistance, global, partitions,
@ -128,6 +129,9 @@ public class yacySearch extends Thread {
} else {
yacyCore.log.logInfo("REMOTE SEARCH - no answer from remote peer " + targetPeer.hash + ":" + targetPeer.getName());
}
} catch (final Exception e) {
e.printStackTrace();
}
}
public static String set2string(final TreeSet<byte[]> hashes) {

Loading…
Cancel
Save