Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- better thread dump - suppressed one server exception
orbiterf4946eaf27d6
diff --git a/htroot/Threaddump_p.java b/htroot/Threaddump_p.javaindex a515a6bd2..40bd1ae79 100644--- a/htroot/Threaddump_p.java+++ b/htroot/Threaddump_p.java@@ -33,6 +33,8 @@ import java.io.File;import java.io.IOException;import java.util.Date;import java.util.Map;+import java.util.SortedSet;+import java.util.TreeSet;import java.util.Map.Entry;import java.util.ArrayList;import java.util.HashMap;@@ -113,12 +115,12 @@ public class Threaddump_p {bufferappend(buffer, plain, "THREADS WITH STATES: " + stateIn.toString());bufferappend(buffer, plain, "");// collect single dumps- HashMap<String, ArrayList<String>> dumps = dumpCollection(rootPath, stackTraces, plain, stateIn);+ HashMap<String, SortedSet<String>> dumps = dumpCollection(rootPath, stackTraces, plain, stateIn);// write dumps- for (final Entry<String, ArrayList<String>> entry: dumps.entrySet()) {- ArrayList<String> threads = entry.getValue();- for (int i = 0; i < threads.size(); i++) bufferappend(buffer, plain, threads.get(i));+ for (final Entry<String, SortedSet<String>> entry: dumps.entrySet()) {+ SortedSet<String> threads = entry.getValue();+ for (String t: threads) bufferappend(buffer, plain, t);bufferappend(buffer, plain, entry.getKey());bufferappend(buffer, plain, "");}@@ -155,12 +157,12 @@ public class Threaddump_p {private static HashMap<String, Integer> dumpStatistic(final File rootPath, final ArrayList<Map<Thread,StackTraceElement[]>> stackTraces, final boolean plain, final Thread.State stateIn) {Map<Thread,StackTraceElement[]> trace;HashMap<String, Integer> result = new HashMap<String, Integer>();- HashMap<String, ArrayList<String>> x;+ HashMap<String, SortedSet<String>> x;int count;for (int i = 0; i < stackTraces.size(); i++) {trace = stackTraces.get(i);x = dumpCollection(rootPath, trace, plain, stateIn);- for (final Entry<String, ArrayList<String>> e: x.entrySet()) {+ for (final Entry<String, SortedSet<String>> e: x.entrySet()) {Integer c = result.get(e.getKey());count = e.getValue().size();if (c == null) result.put(e.getKey(), Integer.valueOf(count));@@ -173,12 +175,12 @@ public class Threaddump_p {return result;}- private static HashMap<String, ArrayList<String>> dumpCollection(final File rootPath, final Map<Thread,StackTraceElement[]> stackTraces, final boolean plain, final Thread.State stateIn) {+ private static HashMap<String, SortedSet<String>> dumpCollection(final File rootPath, final Map<Thread,StackTraceElement[]> stackTraces, final boolean plain, final Thread.State stateIn) {final File classPath = new File(rootPath, "source");Thread thread;// collect single dumps- HashMap<String, ArrayList<String>> dumps = new HashMap<String, ArrayList<String>>();+ HashMap<String, SortedSet<String>> dumps = new HashMap<String, SortedSet<String>>();for (final Entry<Thread, StackTraceElement[]> entry: stackTraces.entrySet()) {thread = entry.getKey();final StackTraceElement[] stackTraceElements = entry.getValue();@@ -220,8 +222,8 @@ public class Threaddump_p {}}String threaddump = sb.toString();- ArrayList<String> threads = dumps.get(threaddump);- if (threads == null) threads = new ArrayList<String>();+ SortedSet<String> threads = dumps.get(threaddump);+ if (threads == null) threads = new TreeSet<String>();threads.add(threadtitle);dumps.put(threaddump, threads);}diff --git a/source/de/anomic/server/serverCore.java b/source/de/anomic/server/serverCore.javaindex 911112509..c8484b53c 100644--- a/source/de/anomic/server/serverCore.java+++ b/source/de/anomic/server/serverCore.java@@ -869,7 +869,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {return null;} catch (final IOException e) {String message = e.getMessage();- if (logerr && !message.equals("Socket closed") && !message.equals("Connection reset")) Log.logWarning("SERVER", "receive closed by IOException: " + e.getMessage());+ if (logerr && !message.equals("Socket closed") && !message.equals("Connection reset") && !message.equals("Read timed out")) Log.logWarning("SERVER", "receive closed by IOException: " + e.getMessage());return null;} finally {try {