Kaynağa Gözat

svn merge -c 1569038 FIXES: MAPREDUCE-5757. ConcurrentModificationException in JobControl.toList. Contributed by Jason Lowe

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1569043 13f79535-47bb-0310-9956-ffa450edef68
Jason Darrell Lowe 11 yıl önce
ebeveyn
işleme
3452748b21

+ 3 - 0
hadoop-mapreduce-project/CHANGES.txt

@@ -26,6 +26,9 @@ Release 2.4.0 - UNRELEASED
     MAPREDUCE-5670. CombineFileRecordReader should report progress when moving
     to the next file (Chen He via jlowe)
 
+    MAPREDUCE-5757. ConcurrentModificationException in JobControl.toList
+    (jlowe)
+
 Release 2.3.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

+ 3 - 3
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java

@@ -77,7 +77,7 @@ public class JobControl implements Runnable {
     this.runnerState = ThreadState.READY;
   }
 	
-  synchronized private static List<ControlledJob> toList(
+  private static List<ControlledJob> toList(
                    LinkedList<ControlledJob> jobs) {
     ArrayList<ControlledJob> retv = new ArrayList<ControlledJob>();
     for (ControlledJob job : jobs) {
@@ -120,11 +120,11 @@ public class JobControl implements Runnable {
   /**
    * @return the jobs in the success state
    */
-  public List<ControlledJob> getSuccessfulJobList() {
+  synchronized public List<ControlledJob> getSuccessfulJobList() {
     return toList(this.successfulJobs);
   }
 	
-  public List<ControlledJob> getFailedJobList() {
+  synchronized public List<ControlledJob> getFailedJobList() {
     return toList(this.failedJobs);
   }