Author: orbiter
Date: 2007-10-03 16:34:05 +0200 (Wed, 03 Oct 2007)
New Revision: 4133

Modified:
   trunk/source/de/anomic/http/httpc.java
   trunk/source/de/anomic/http/httpdProxyHandler.java
   trunk/source/de/anomic/plasma/plasmaSearchEvent.java
   trunk/source/de/anomic/server/serverFileUtils.java
Log:
- reverted svn 4132; this did not solve the problem and removed the emergency 
mehtod which caused production failure for shure within some hours
- removed and added some debugging lines

Modified: trunk/source/de/anomic/http/httpc.java
===================================================================
--- trunk/source/de/anomic/http/httpc.java      2007-10-03 12:18:26 UTC (rev 
4132)
+++ trunk/source/de/anomic/http/httpc.java      2007-10-03 14:34:05 UTC (rev 
4133)
@@ -227,10 +227,14 @@
             String outgoingByteCountAccounting            
     ) throws IOException {
         
-        // TODO method can be removed completely when no more CLOSE_WAIT 
connections appear.
-       // remove old connections
-       //checkIdleConnections();
+        // remove old connections
+        // do NOT remove this check; in case that everything works fine this 
call does nothing
+        // but if in any arror case connections stay open, this will ensure 
that the peer keeps running and the host server is not blocked from working
+       checkIdleConnections();
        
+        // register new connection
+        this.hashIndex = objCounter;
+        
        // register new connection
        this.hashIndex = objCounter;
        objCounter++;
@@ -387,13 +391,15 @@
                 address = new InetSocketAddress(hostip, port);
             } else {
                 address = new InetSocketAddress(server,port);
-            }            
-
+            }
+            
             // trying to establish a connection to the address
             this.initTime = System.currentTimeMillis();
-            this.socket.setKeepAlive(false); //
+            this.socket.setKeepAlive(false);
             this.socket.connect(address, timeout);
-
+            // setting socket timeout and keep alive behaviour
+            this.socket.setSoTimeout(timeout); // waiting time for read
+            
             if (incomingByteCountAccounting != null) {
                 this.clientInputByteCount = new 
httpdByteCountInputStream(this.socket.getInputStream(),incomingByteCountAccounting);
             }
@@ -434,7 +440,6 @@
         return (this.clientOutputByteCount == 
null)?0:this.clientOutputByteCount.getCount();
     }
 
-    // TODO remove when it's sure that the CLOSE_WAIT problem was solved.
     public static int checkIdleConnections() {
         // try to find and close all connections that did not find a target 
server and are idle waiting for a server socket
         
@@ -514,7 +519,7 @@
     
     public void close() {
        synchronized (activeConnections) {activeConnections.remove(this);}
-       System.out.println("*** DEBUG close httpc: " + activeConnections.size() 
+ " connections online");
+       //System.out.println("*** DEBUG close httpc: " + 
activeConnections.size() + " connections online");
        
         if (this.clientInput != null) {
             try {this.clientInput.close();} catch (Exception e) {}

Modified: trunk/source/de/anomic/http/httpdProxyHandler.java
===================================================================
--- trunk/source/de/anomic/http/httpdProxyHandler.java  2007-10-03 12:18:26 UTC 
(rev 4132)
+++ trunk/source/de/anomic/http/httpdProxyHandler.java  2007-10-03 14:34:05 UTC 
(rev 4133)
@@ -861,7 +861,7 @@
         }
     }
     
-    public static void doHead(Properties conProp, httpHeader requestHeader, 
OutputStream respond) throws IOException {
+    public static void doHead(Properties conProp, httpHeader requestHeader, 
OutputStream respond) {
         
         httpc remote = null;
         httpc.response res = null;

Modified: trunk/source/de/anomic/plasma/plasmaSearchEvent.java
===================================================================
--- trunk/source/de/anomic/plasma/plasmaSearchEvent.java        2007-10-03 
12:18:26 UTC (rev 4132)
+++ trunk/source/de/anomic/plasma/plasmaSearchEvent.java        2007-10-03 
14:34:05 UTC (rev 4133)
@@ -362,24 +362,24 @@
             (!(comp.title().startsWith("Index of")))) {
             final Iterator wi = query.queryHashes.iterator();
             while (wi.hasNext()) wordIndex.removeEntry((String) wi.next(), 
page.hash());
-            registerFailure(page.hash(), "index-of constrained not 
fullfilled");
+            registerFailure(page.hash(), "index-of constraint not fullfilled");
             return null;
         }
         
         if ((query.contentdom == plasmaSearchQuery.CONTENTDOM_AUDIO) && 
(page.laudio() == 0)) {
-            registerFailure(page.hash(), "contentdom-audio constrained not 
fullfilled");
+            registerFailure(page.hash(), "contentdom-audio constraint not 
fullfilled");
             return null;
         }
         if ((query.contentdom == plasmaSearchQuery.CONTENTDOM_VIDEO) && 
(page.lvideo() == 0)) {
-            registerFailure(page.hash(), "contentdom-video constrained not 
fullfilled");
+            registerFailure(page.hash(), "contentdom-video constraint not 
fullfilled");
             return null;
         }
         if ((query.contentdom == plasmaSearchQuery.CONTENTDOM_IMAGE) && 
(page.limage() == 0)) {
-            registerFailure(page.hash(), "contentdom-image constrained not 
fullfilled");
+            registerFailure(page.hash(), "contentdom-image constraint not 
fullfilled");
             return null;
         }
         if ((query.contentdom == plasmaSearchQuery.CONTENTDOM_APP) && 
(page.lapp() == 0)) {
-            registerFailure(page.hash(), "contentdom-app constrained not 
fullfilled");
+            registerFailure(page.hash(), "contentdom-app constraint not 
fullfilled");
             return null;
         }
             
@@ -389,6 +389,7 @@
             startTime = System.currentTimeMillis();
             plasmaSnippetCache.TextSnippet snippet = 
plasmaSnippetCache.retrieveTextSnippet(comp.url(), snippetFetchWordHashes, 
fetchSnippetOnline, query.constraint.get(plasmaCondenser.flag_cat_indexof), 
180, 3000, (fetchSnippetOnline) ? Integer.MAX_VALUE : 100000);
             long snippetComputationTime = System.currentTimeMillis() - 
startTime;
+            serverLog.logInfo("SEARCH_EVENT", "text snippet load time for " + 
comp.url() + ": " + snippetComputationTime);
             
             if (snippet.getErrorCode() < 11) {
                 // we loaded the file and found the snippet
@@ -408,6 +409,7 @@
             startTime = System.currentTimeMillis();
             ArrayList mediaSnippets = 
plasmaSnippetCache.retrieveMediaSnippets(comp.url(), snippetFetchWordHashes, 
query.contentdom, fetchSnippetOnline, 6000);
             long snippetComputationTime = System.currentTimeMillis() - 
startTime;
+            serverLog.logInfo("SEARCH_EVENT", "media snippet load time for " + 
comp.url() + ": " + snippetComputationTime);
             
             if ((mediaSnippets != null) && (mediaSnippets.size() > 0)) {
                 // found media snippets, return entry

Modified: trunk/source/de/anomic/server/serverFileUtils.java
===================================================================
--- trunk/source/de/anomic/server/serverFileUtils.java  2007-10-03 12:18:26 UTC 
(rev 4132)
+++ trunk/source/de/anomic/server/serverFileUtils.java  2007-10-03 14:34:05 UTC 
(rev 4133)
@@ -122,7 +122,7 @@
             if (procOS != null) procOS.write(buffer, 0, l);
             if (bufferOS != null) bufferOS.write(buffer, 0, l);
         } catch (IOException e) {
-            System.out.println("** DEBUG: writeX/IOStream terminated with 
IOException, processed " + c + " bytes.");
+            //System.out.println("*** DEBUG: writeX/IOStream terminated with 
IOException, processed " + c + " bytes.");
             break;
         }
         
@@ -143,7 +143,7 @@
             if (procOS != null) procOS.write(buffer, 0, l);
             if (bufferOS != null) bufferOS.write(buffer, 0, l);
         } catch (IOException e) {
-            System.out.println("** DEBUG: writeX/ReaderWriter terminated with 
IOException, processed " + c + " bytes.");
+            //System.out.println("*** DEBUG: writeX/ReaderWriter terminated 
with IOException, processed " + c + " bytes.");
             break;
         }
         

_______________________________________________
YaCy-svn mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/yacy-svn

Antwort per Email an