hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r754847 - in /hadoop/core/trunk: CHANGES.txt src/mapred/org/apache/hadoop/mapred/EagerTaskInitializationListener.java
Date Mon, 16 Mar 2009 08:46:53 GMT
Author: ddas
Date: Mon Mar 16 08:46:53 2009
New Revision: 754847

URL: http://svn.apache.org/viewvc?rev=754847&view=rev
Log:
HADOOP-5490. Fixes a synchronization problem in the EagerTaskInitializationListener class.
Contributed by Jothi Padmanabhan.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/EagerTaskInitializationListener.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=754847&r1=754846&r2=754847&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Mon Mar 16 08:46:53 2009
@@ -998,6 +998,9 @@
     HADOOP-5278. Fixes a problem to do with logging the finish time of a task during
     recovery (after a JobTracker restart). (Amar Kamat via ddas)
 
+    HADOOP-5490. Fixes a synchronization problem in the EagerTaskInitializationListener
+    class. (Jothi Padmanabhan via ddas)
+
 Release 0.19.2 - Unreleased
 
   BUG FIXES

Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/EagerTaskInitializationListener.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/EagerTaskInitializationListener.java?rev=754847&r1=754846&r2=754847&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/EagerTaskInitializationListener.java
(original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/EagerTaskInitializationListener.java
Mon Mar 16 08:46:53 2009
@@ -51,14 +51,11 @@
       while (true) {
         try {
           synchronized (jobInitQueue) {
-            while (jobInitQueue.isEmpty() && !exitFlag) {
+            while (jobInitQueue.isEmpty()) {
               jobInitQueue.wait();
             }
-            if (exitFlag) {
-              break;
-            }
+            job = jobInitQueue.remove(0);
           }
-          job = jobInitQueue.remove(0);
           threadPool.execute(new InitJob(job));
         } catch (InterruptedException t) {
           LOG.info("JobInitManagerThread interrupted.");
@@ -97,7 +94,6 @@
   private List<JobInProgress> jobInitQueue = new ArrayList<JobInProgress>();
   private ExecutorService threadPool;
   private int numThreads;
-  private boolean exitFlag = false;
   
   public EagerTaskInitializationListener(Configuration conf) {
     numThreads = conf.getInt("mapred.jobinit.threads", DEFAULT_NUM_THREADS);
@@ -113,10 +109,7 @@
   public void terminate() throws IOException {
     if (jobInitManagerThread != null && jobInitManagerThread.isAlive()) {
       LOG.info("Stopping Job Init Manager thread");
-      synchronized (jobInitQueue) {
-        exitFlag = true;
-        jobInitQueue.notify();
-      }
+      jobInitManagerThread.interrupt();
       try {
         jobInitManagerThread.join();
       } catch (InterruptedException ex) {



Mime
View raw message