Author: toad
Date: 2009-03-13 21:01:05 +0000 (Fri, 13 Mar 2009)
New Revision: 26022

Modified:
   branches/db4o/freenet/src/freenet/node/Node.java
   branches/db4o/freenet/src/freenet/node/NodeClientCore.java
Log:
Kill the database early in the shutdown process. I was seeing some *very* wierd 
bugs show up during shutdown.


Modified: branches/db4o/freenet/src/freenet/node/Node.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/Node.java    2009-03-13 20:55:00 UTC 
(rev 26021)
+++ branches/db4o/freenet/src/freenet/node/Node.java    2009-03-13 21:01:05 UTC 
(rev 26022)
@@ -884,6 +884,15 @@
                        }
                });
                
+               shutdownHook.addEarlyJob(new Thread() {
+                       
+                       public void run() {
+                               System.err.println("Stopping database jobs...");
+                               clientCore.killDatabase();
+                       }
+                       
+               });
+               
                shutdownHook.addLateJob(new Thread() {
 
                        public void run() {

Modified: branches/db4o/freenet/src/freenet/node/NodeClientCore.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/NodeClientCore.java  2009-03-13 
20:55:00 UTC (rev 26021)
+++ branches/db4o/freenet/src/freenet/node/NodeClientCore.java  2009-03-13 
21:01:05 UTC (rev 26022)
@@ -1484,5 +1484,9 @@
                Logger.error(this, "Not storing NodeClientCore in database", 
new Exception("error"));
                return false;
        }
+
+       public synchronized void killDatabase() {
+               killedDatabase = true;
+       }
        
 }

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to