hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r581427 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/util/Progress.java
Date Tue, 02 Oct 2007 22:59:13 GMT
Author: omalley
Date: Tue Oct  2 15:59:12 2007
New Revision: 581427

URL: http://svn.apache.org/viewvc?rev=581427&view=rev
Log:
HADOOP-1970.  Fix deadlock in reporting progress. (Vivek Ratan via omalley)

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/util/Progress.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=581427&r1=581426&r2=581427&view=diff
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Tue Oct  2 15:59:12 2007
@@ -348,12 +348,15 @@
 
     HADOOP-1862.  reduces are getting stuck trying to find map outputs. 
     (Arun C. Murthy via ddas)
-
+ 
     HADOOP-1977. Fixed handling of ToolBase cli options in JobClient.
     (enis via omalley)
 
     HADOOP-1972.  Fix LzoCompressor to ensure the user has actually asked
     to finish compression. (arun via omalley)
+
+    HADOOP-1970.  Fix deadlock in progress reporting in the task. (Vivek
+    Ratan via omalley)
 
 Release 0.14.1 - 2007-09-04
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/util/Progress.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/util/Progress.java?rev=581427&r1=581426&r2=581427&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/util/Progress.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/util/Progress.java Tue Oct  2 15:59:12
2007
@@ -64,10 +64,19 @@
   }
 
   /** Completes this node, moving the parent node to its next child. */
-  public synchronized void complete() {
-    progress = 1.0f;
-    if (parent != null) {
-      parent.startNextPhase();
+  public void complete() {
+    // we have to traverse up to our parent, so be careful about locking.
+    Progress myParent;
+    synchronized(this) {
+      progress = 1.0f;
+      myParent = parent;
+    }
+    if (myParent != null) {
+      // this will synchronize on the parent, so we make sure we release
+      // our lock before getting the parent's, since we're traversing 
+      // against the normal traversal direction used by get() or toString().
+      // We don't need transactional semantics, so we're OK doing this. 
+      myParent.startNextPhase();
     }
   }
 



Mime
View raw message