Author: toad
Date: 2007-03-15 21:49:52 +0000 (Thu, 15 Mar 2007)
New Revision: 12147

Modified:
   trunk/freenet/src/freenet/node/CHKInsertSender.java
Log:
Fail gracefully rather than hanging

Modified: trunk/freenet/src/freenet/node/CHKInsertSender.java
===================================================================
--- trunk/freenet/src/freenet/node/CHKInsertSender.java 2007-03-15 21:46:41 UTC 
(rev 12146)
+++ trunk/freenet/src/freenet/node/CHKInsertSender.java 2007-03-15 21:49:52 UTC 
(rev 12147)
@@ -205,7 +205,7 @@
     public void run() {
         short origHTL;
        synchronized (this) {
-            origHTL = htl;                     
+            origHTL = htl;
                }

         node.addInsertSender(myKey, origHTL, this);
@@ -213,6 +213,12 @@
                realRun();
                } catch (OutOfMemoryError e) {
                        OOMHandler.handleOOM(e);
+            int myStatus;
+            synchronized (this) {
+                               myStatus = status;
+                       }
+            if(myStatus == NOT_FINISHED)
+               finish(INTERNAL_ERROR, null);
         } catch (Throwable t) {
             Logger.error(this, "Caught "+t, t);
             int myStatus;


Reply via email to