hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r581428 - in /lucene/hadoop/branches/branch-0.14: CHANGES.txt src/java/org/apache/hadoop/util/Progress.java
Date Tue, 02 Oct 2007 23:01:53 GMT
Author: omalley
Date: Tue Oct  2 16:01:52 2007
New Revision: 581428

URL: http://svn.apache.org/viewvc?rev=581428&view=rev
Log:
merge -r581426:581427 from trunk to 0.14. Fixed HADOOP-1970.

Modified:
    lucene/hadoop/branches/branch-0.14/CHANGES.txt
    lucene/hadoop/branches/branch-0.14/src/java/org/apache/hadoop/util/Progress.java

Modified: lucene/hadoop/branches/branch-0.14/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/branches/branch-0.14/CHANGES.txt?rev=581428&r1=581427&r2=581428&view=diff
==============================================================================
--- lucene/hadoop/branches/branch-0.14/CHANGES.txt (original)
+++ lucene/hadoop/branches/branch-0.14/CHANGES.txt Tue Oct  2 16:01:52 2007
@@ -17,6 +17,9 @@
     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
 
   BUG FIXES

Modified: lucene/hadoop/branches/branch-0.14/src/java/org/apache/hadoop/util/Progress.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/branches/branch-0.14/src/java/org/apache/hadoop/util/Progress.java?rev=581428&r1=581427&r2=581428&view=diff
==============================================================================
--- lucene/hadoop/branches/branch-0.14/src/java/org/apache/hadoop/util/Progress.java (original)
+++ lucene/hadoop/branches/branch-0.14/src/java/org/apache/hadoop/util/Progress.java Tue Oct
 2 16:01:52 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