You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2011/03/29 19:33:37 UTC

svn commit: r1086646 - in /hadoop/common/branches/branch-0.20-security-203: CHANGES.txt src/mapred/org/apache/hadoop/mapred/TaskTracker.java

Author: omalley
Date: Tue Mar 29 17:33:37 2011
New Revision: 1086646

URL: http://svn.apache.org/viewvc?rev=1086646&view=rev
Log:
MAPREDUCE-2355. Add a dampner to out-of-band heartbeats. (acmurthy) 

Modified:
    hadoop/common/branches/branch-0.20-security-203/CHANGES.txt
    hadoop/common/branches/branch-0.20-security-203/src/mapred/org/apache/hadoop/mapred/TaskTracker.java

Modified: hadoop/common/branches/branch-0.20-security-203/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-203/CHANGES.txt?rev=1086646&r1=1086645&r2=1086646&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-203/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20-security-203/CHANGES.txt Tue Mar 29 17:33:37 2011
@@ -2,6 +2,8 @@ Hadoop Change Log
 
 Release 0.20.203.0 - unreleased
 
+    MAPREDUCE-2355. Add a dampner to out-of-band heartbeats. (acmurthy) 
+ 
     HADOOP-7190. Add metrics v1 back for backwards compatibility. (omalley)
 
     MAPREDUCE-2360. Remove stripping of scheme, authority from submit dir in 

Modified: hadoop/common/branches/branch-0.20-security-203/src/mapred/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-203/src/mapred/org/apache/hadoop/mapred/TaskTracker.java?rev=1086646&r1=1086645&r2=1086646&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-203/src/mapred/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ hadoop/common/branches/branch-0.20-security-203/src/mapred/org/apache/hadoop/mapred/TaskTracker.java Tue Mar 29 17:33:37 2011
@@ -1426,25 +1426,21 @@ public class TaskTracker implements MRCo
         long now = System.currentTimeMillis();
         
         // accelerate to account for multiple finished tasks up-front
-        long remaining = 
-          (lastHeartbeat + getHeartbeatInterval(finishedCount.get())) - now;
-        while (remaining > 0) {
-          // sleeps for the wait time or 
-          // until there are *enough* empty slots to schedule tasks
-          synchronized (finishedCount) {
+        synchronized (finishedCount) {
+          long remaining = 
+            (lastHeartbeat + getHeartbeatInterval(finishedCount.get())) - now;
+          while (remaining > 0) {
+            // sleeps for the wait time or 
+            // until there are *enough* empty slots to schedule tasks
             finishedCount.wait(remaining);
-            
+
             // Recompute
             now = System.currentTimeMillis();
             remaining = 
               (lastHeartbeat + getHeartbeatInterval(finishedCount.get())) - now;
-            
-            if (remaining <= 0) {
-              // Reset count 
-              finishedCount.set(0);
-              break;
-            }
           }
+          // Reset count 
+          finishedCount.set(0);
         }
 
         // If the TaskTracker is just starting up: