hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yhema...@apache.org
Subject svn commit: r755986 - in /hadoop/core/trunk: CHANGES.txt src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairSchedulerServlet.java
Date Thu, 19 Mar 2009 13:18:46 GMT
Author: yhemanth
Date: Thu Mar 19 13:18:46 2009
New Revision: 755986

URL: http://svn.apache.org/viewvc?rev=755986&view=rev
Log:
HADOOP-5534. Fixed a deadlock in Fair scheduler's servlet. Contributed by Rahul Kumar Singh.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairSchedulerServlet.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=755986&r1=755985&r2=755986&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu Mar 19 13:18:46 2009
@@ -1053,6 +1053,9 @@
     HADOOP-5471. Fixes a problem to do with updating the log.index file in the 
     case where a cleanup task is run. (Amareshwari Sriramadasu via ddas)
 
+    HADOOP-5534. Fixed a deadlock in Fair scheduler's servlet.
+    (Rahul Kumar Singh via yhemanth)
+
 Release 0.19.2 - Unreleased
 
   BUG FIXES

Modified: hadoop/core/trunk/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairSchedulerServlet.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairSchedulerServlet.java?rev=755986&r1=755985&r2=755986&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairSchedulerServlet.java
(original)
+++ hadoop/core/trunk/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairSchedulerServlet.java
Thu Mar 19 13:18:46 2009
@@ -87,35 +87,36 @@
     }
     if (request.getParameter("setPool") != null) {
       Collection<JobInProgress> runningJobs = jobTracker.getRunningJobs();
+      PoolManager poolMgr = null;
       synchronized (scheduler) {
-        PoolManager poolMgr = scheduler.getPoolManager();
-        String pool = request.getParameter("setPool");
-        String jobId = request.getParameter("jobid");
-        for (JobInProgress job: runningJobs) {
-          if (job.getProfile().getJobID().toString().equals(jobId)) {
+        poolMgr = scheduler.getPoolManager();
+      }
+      String pool = request.getParameter("setPool");
+      String jobId = request.getParameter("jobid");
+      for (JobInProgress job: runningJobs) {
+        if (job.getProfile().getJobID().toString().equals(jobId)) {
+          synchronized(scheduler){
             poolMgr.setPool(job, pool);
-            scheduler.update();
-            break;
           }
+          scheduler.update();
+          break;
         }
-      }
+      }      
       response.sendRedirect("/scheduler" + (advancedView ? "?advanced" : ""));
       return;
     }
     if (request.getParameter("setPriority") != null) {
-      Collection<JobInProgress> runningJobs = jobTracker.getRunningJobs();
-      synchronized (scheduler) {
-        JobPriority priority = JobPriority.valueOf(request.getParameter(
-            "setPriority"));
-        String jobId = request.getParameter("jobid");
-        for (JobInProgress job: runningJobs) {
-          if (job.getProfile().getJobID().toString().equals(jobId)) {
-            job.setPriority(priority);
-            scheduler.update();
-            break;
-          }
+      Collection<JobInProgress> runningJobs = jobTracker.getRunningJobs();      
+      JobPriority priority = JobPriority.valueOf(request.getParameter(
+          "setPriority"));
+      String jobId = request.getParameter("jobid");
+      for (JobInProgress job: runningJobs) {
+        if (job.getProfile().getJobID().toString().equals(jobId)) {
+          job.setPriority(priority);
+          scheduler.update();
+          break;
         }
-      }
+      }      
       response.sendRedirect("/scheduler" + (advancedView ? "?advanced" : ""));
       return;
     }



Mime
View raw message