hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1365851 - in /hadoop/common/branches/branch-1.1: CHANGES.txt src/mapred/org/apache/hadoop/mapred/Task.java
Date Thu, 26 Jul 2012 00:08:36 GMT
Author: llu
Date: Thu Jul 26 00:08:36 2012
New Revision: 1365851

URL: http://svn.apache.org/viewvc?rev=1365851&view=rev
Log:
MAPREDUCE-4400: Avoid task finish sleep to improve small job/workflow latency. (llu)

Modified:
    hadoop/common/branches/branch-1.1/CHANGES.txt
    hadoop/common/branches/branch-1.1/src/mapred/org/apache/hadoop/mapred/Task.java

Modified: hadoop/common/branches/branch-1.1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.1/CHANGES.txt?rev=1365851&r1=1365850&r2=1365851&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1.1/CHANGES.txt Thu Jul 26 00:08:36 2012
@@ -143,6 +143,9 @@ Release 1.1.0 - 2012.07.09
     MAPREDUCE-4399. Change the Jetty response buffer size to improve 
     shuffle performance. (Luke Lu via suresh)
 
+    MAPREDUCE-4400. Avoid task finish sleep to improve small job/workflow
+    latency. (llu)
+
   BUG FIXES
 
     MAPREDUCE-4087. [Gridmix] GenerateDistCacheData job of Gridmix can

Modified: hadoop/common/branches/branch-1.1/src/mapred/org/apache/hadoop/mapred/Task.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.1/src/mapred/org/apache/hadoop/mapred/Task.java?rev=1365851&r1=1365850&r2=1365851&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.1/src/mapred/org/apache/hadoop/mapred/Task.java (original)
+++ hadoop/common/branches/branch-1.1/src/mapred/org/apache/hadoop/mapred/Task.java Thu Jul
26 00:08:36 2012
@@ -649,14 +649,19 @@ abstract public class Task implements Wr
       // get current flag value and reset it as well
       boolean sendProgress = resetProgressFlag();
       while (!taskDone.get()) {
-        synchronized(lock) {
-          done = false;
-        }
         try {
           boolean taskFound = true; // whether TT knows about this task
           // sleep for a bit
           try {
-            Thread.sleep(PROGRESS_INTERVAL);
+            synchronized(lock) {
+              done = false;
+              lock.wait(PROGRESS_INTERVAL);
+              if (taskDone.get()) {
+                done = true;
+                lock.notify();
+                return;
+              }
+            }
           } 
           catch (InterruptedException e) {
             if (LOG.isDebugEnabled()) {
@@ -724,6 +729,7 @@ abstract public class Task implements Wr
       // Updating resources specified in ResourceCalculatorPlugin
       if (pingThread != null) {
         synchronized(lock) {
+          lock.notify(); // wake up the wait in the while loop
           while(!done) {
             lock.wait();
           }



Mime
View raw message