Author: toad
Date: 2009-03-04 18:31:34 +0000 (Wed, 04 Mar 2009)
New Revision: 25892

Modified:
   trunk/freenet/src/freenet/node/NodePinger.java
Log:
Requeue after is better - partial revert of 25484


Modified: trunk/freenet/src/freenet/node/NodePinger.java
===================================================================
--- trunk/freenet/src/freenet/node/NodePinger.java      2009-03-04 18:30:30 UTC 
(rev 25891)
+++ trunk/freenet/src/freenet/node/NodePinger.java      2009-03-04 18:31:34 UTC 
(rev 25892)
@@ -38,9 +38,7 @@
        }
        
        public void run() {
-        // Requeue *before* so that it's accurate in any case
-        node.ps.queueTimedJob(this, 200);
-        
+        try {
         PeerNode[] peers = null;
         synchronized(node.peers) {
            if((node.peers.connectedPeers == null) || 
(node.peers.connectedPeers.length == 0)) return;
@@ -50,6 +48,10 @@
 
         // Now we don't have to care about synchronization anymore
         recalculateMean(peers);
+        } finally {
+               // Requeue after to avoid exacerbating overload
+               node.ps.queueTimedJob(this, 200);
+        }
        }
 
        /** Recalculate the mean ping time */

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

Reply via email to