hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r574888 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/TaskStatus.java
Date Wed, 12 Sep 2007 11:20:14 GMT
Author: acmurthy
Date: Wed Sep 12 04:20:13 2007
New Revision: 574888

URL: http://svn.apache.org/viewvc?rev=574888&view=rev
Log:
HADOOP-1840. Fix race condition which leads to task's diagnostic messages getting lost.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskStatus.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=574888&r1=574887&r2=574888&view=diff
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed Sep 12 04:20:13 2007
@@ -118,6 +118,9 @@
     HADOOP-1818. Fix MultiFileInputFormat so that it does not return 
     empty splits when numPaths < numSplits.  (Thomas Friol via enis)
 
+    HADOOP-1840. Fix race condition which leads to task's diagnostic
+    messages getting lost. (acmurthy) 
+
   IMPROVEMENTS
 
     HADOOP-1266. Remove dependency of package org.apache.hadoop.net on 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskStatus.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskStatus.java?rev=574888&r1=574887&r2=574888&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskStatus.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskStatus.java Wed Sep 12 04:20:13
2007
@@ -80,7 +80,10 @@
   public void setTaskTracker(String tracker) { this.taskTracker = tracker;}
   public void setRunState(State runState) { this.runState = runState; }
   public String getDiagnosticInfo() { return diagnosticInfo; }
-  public void setDiagnosticInfo(String info) { this.diagnosticInfo = info; }
+  public void setDiagnosticInfo(String info) { 
+    diagnosticInfo = 
+      ((diagnosticInfo == null) ? info : diagnosticInfo.concat(info)); 
+  }
   public String getStateString() { return stateString; }
   public void setStateString(String stateString) { this.stateString = stateString; }
   /**
@@ -231,9 +234,10 @@
   synchronized void statusUpdate(TaskStatus status) {
     this.progress = status.getProgress();
     this.runState = status.getRunState();
-    this.diagnosticInfo = status.getDiagnosticInfo();
     this.stateString = status.getStateString();
-      
+
+    setDiagnosticInfo(status.getDiagnosticInfo());
+    
     if (status.getStartTime() != 0) {
       this.startTime = status.getStartTime(); 
     }
@@ -246,10 +250,14 @@
   }
   
   /**
-   * Clear out transient information after sending out a status update
-   * to the {@link TaskTracker}.
-   */
-  synchronized void clearStatus() {}
+   * Clear out transient information after sending out a status-update
+   * from either the {@link Task} to the {@link TaskTracker} or from the
+   * {@link TaskTracker} to the {@link JobTracker}. 
+   */
+  synchronized void clearStatus() {
+    // Clear diagnosticInfo
+    diagnosticInfo = "";
+  }
 
   public Object clone() {
     try {



Mime
View raw message