From e3025ee69187456d75e94531d2ed8b8853571c04 Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 5 Nov 2009 16:40:15 +0000 Subject: [PATCH] - new icon for OAI-PMH loading action - added many stack trace outputs for exceptions in crawl profile handler to find the 'missing profile handle' bug - catched one more timeout exception in httpd file loader git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6457 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/IndexImportOAIPMHList_p.java | 2 +- htroot/env/grafics/loading.gif | Bin 0 -> 1101 bytes source/de/anomic/crawler/CrawlProfile.java | 19 +++++++++++++++--- .../anomic/http/server/HTTPDFileHandler.java | 6 +++--- source/de/anomic/server/serverCore.java | 1 + 5 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 htroot/env/grafics/loading.gif diff --git a/htroot/IndexImportOAIPMHList_p.java b/htroot/IndexImportOAIPMHList_p.java index 7ff7592d6..33454e3b8 100644 --- a/htroot/IndexImportOAIPMHList_p.java +++ b/htroot/IndexImportOAIPMHList_p.java @@ -67,7 +67,7 @@ public class IndexImportOAIPMHList_p { int cnt = 0; for (OAIPMHImporter job: jobs) { prop.put("import_table_" + cnt + "_dark", (dark) ? "1" : "0"); - prop.put("import_table_" + cnt + "_thread", (job.isAlive()) ? "\"running\"" : "finished"); + prop.put("import_table_" + cnt + "_thread", (job.isAlive()) ? "\"running\"" : "finished"); prop.put("import_table_" + cnt + "_source", job.source()); prop.put("import_table_" + cnt + "_chunkCount", job.chunkCount()); prop.put("import_table_" + cnt + "_recordsCount", job.count()); diff --git a/htroot/env/grafics/loading.gif b/htroot/env/grafics/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..da8e1c6451baaf14e80feac646c47780c2c346c2 GIT binary patch literal 1101 zcmbu8O-Phc6o$`WKgy7!1regDBT9&vc_OSfir?f9`IF;7v{H#fnj1x!idv|kQ-~32 zb-}<|Bn~AuZi?9`MHt+mw&g^df}m#G&!XFVzE!&x-QD@lz3+M6_sq1kooYDVe~g0k zz2u0~W1Tb3iF526X=Sam##wQeoh5A=>x^+moMC53?}~L|oQM;4Li&`gW8+vHvtxpi zBkRaG5=ZO^1+*azEj-3;(m8sJwPGz>OF9;nG1iDRYz-*|nqsVo6}CbOg}ZDli)FS< zV8l~P#*$cKOPC63hyfauz(Nm$p$%zh;W4Qpt#QN{Hipz6#-b82!bV8#f&xtz!)%z~ z9#FVzNDQ$d*h3z`#B0O>|A2r)P(uvRpu|;hU@){H4K32-w2c~vMM#5$Ka54iEKJB1 zc0qxr5DOtkB#i*Th3g0!ZV@H&0481|4luzm9D*8RfW}K;fdhk~4QbL9>20)8;}AB6 zAmI;VQ8AG&&|kk&_#4%I`b$zMKX+ZPAEh$->FBn7!;0*C(B=DB>cF1_Y5W|pC4>i0 zS)vS4nkY$>Ac_;kh&-Y&Q6Vt?qn*uWGnq^}olYi`i9{kEkH=y$&-23JaABcpm%CtR zq&M2!)E%j>t;-4Mr{94xD*w47uLe~OK9K%bD0iJgV+UH-mNqAI_f>njOV7ur3o6kyE@_w5KRl`DQL!dg1Z)(ZSC9eC=0FTdcA>fB)JE?_JMe z*TaU9)T6%sZ+5Qh^{!a(*6RCvRi(F!FZFz$TsSu=W7NAgFwvGCT|E7BV0tRZ7e5Ra zG&cG^>S5t8AMO9}u{ARAa<;7b%GjaQ`K_B((IIao^{MqvU1e(K%V<@{LP=5W_N(>f JCJF@T().iterator(); } } @@ -117,6 +118,7 @@ public class CrawlProfile { try { return handleIterator.hasNext(); } catch (final kelondroException e) { + e.printStackTrace(); clear(); return false; } @@ -126,6 +128,7 @@ public class CrawlProfile { lastkey = new String(handleIterator.next()); return getEntry(lastkey); } catch (final kelondroException e) { + e.printStackTrace(); clear(); return null; } @@ -134,6 +137,7 @@ public class CrawlProfile { if (lastkey != null) try { removeEntry(lastkey); } catch (final kelondroException e) { + e.printStackTrace(); clear(); } } @@ -141,8 +145,10 @@ public class CrawlProfile { public void removeEntry(final String handle) { try { - profileTable.remove(handle); - } catch (final IOException e) {} + profileTable.remove(handle); + } catch (final IOException e) { + e.printStackTrace(); + } } public entry newEntry(final Map mem) { @@ -218,6 +224,7 @@ public class CrawlProfile { try { return profileTable.has(handle); } catch (final IOException e) { + e.printStackTrace(); return false; } } @@ -227,6 +234,7 @@ public class CrawlProfile { try { m = profileTable.get(handle); } catch (final IOException e) { + e.printStackTrace(); return null; } if (m == null) return null; @@ -384,6 +392,7 @@ public class CrawlProfile { try { return Integer.parseInt(r); } catch (final NumberFormatException e) { + e.printStackTrace(); return 0; } } @@ -393,6 +402,7 @@ public class CrawlProfile { try { return Integer.parseInt(r); } catch (final NumberFormatException e) { + e.printStackTrace(); return CACHE_STRATEGY_IFFRESH; } } @@ -405,6 +415,7 @@ public class CrawlProfile { final long l = Long.parseLong(r); return (l < 0) ? 0L : l; } catch (final NumberFormatException e) { + e.printStackTrace(); return 0L; } } @@ -419,6 +430,7 @@ public class CrawlProfile { if (i < 0) return Integer.MAX_VALUE; return i; } catch (final NumberFormatException e) { + e.printStackTrace(); return Integer.MAX_VALUE; } } @@ -432,6 +444,7 @@ public class CrawlProfile { if (i < 0) return Integer.MAX_VALUE; return i; } catch (final NumberFormatException e) { + e.printStackTrace(); return Integer.MAX_VALUE; } } @@ -529,7 +542,7 @@ public class CrawlProfile { ey = domnamesi.next(); i++; } - if(domnamesi.hasNext()){ + if (domnamesi.hasNext()) { ey = domnamesi.next(); dp = ey.getValue(); domname = ey.getKey() + ((attr) ? ("/r=" + dp.referrer + ", d=" + dp.depth + ", c=" + dp.count) : " "); diff --git a/source/de/anomic/http/server/HTTPDFileHandler.java b/source/de/anomic/http/server/HTTPDFileHandler.java index 0b3464b0c..adc26a378 100644 --- a/source/de/anomic/http/server/HTTPDFileHandler.java +++ b/source/de/anomic/http/server/HTTPDFileHandler.java @@ -1049,14 +1049,14 @@ public final class HTTPDFileHandler { } else { if ((errorMsg != null) && ( - errorMsg.contains("Broken pipe") || + errorMsg.contains("Broken pipe") || errorMsg.contains("Connection reset") || + errorMsg.contains("Read timed out") || + errorMsg.contains("Connection timed out") || errorMsg.contains("Software caused connection abort") )) { // client closed the connection, so we just end silently errorMessage.append("Client unexpectedly closed connection while processing query."); - } else if ((errorMsg != null) && (errorMsg.startsWith("Connection timed out"))) { - errorMessage.append("Connection timed out."); } else { errorMessage.append("Unexpected error while processing query."); httpStatusCode = 500; diff --git a/source/de/anomic/server/serverCore.java b/source/de/anomic/server/serverCore.java index 3e2066de4..2d89a2f3c 100644 --- a/source/de/anomic/server/serverCore.java +++ b/source/de/anomic/server/serverCore.java @@ -42,6 +42,7 @@ import java.net.NetworkInterface; import java.net.ServerSocket; import java.net.Socket; import java.net.SocketException; +import java.net.SocketTimeoutException; import java.nio.channels.ClosedByInterruptException; import java.security.KeyStore; import java.util.ArrayList;