hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r1499899 - in /hadoop/common/branches/branch-1.2: CHANGES.txt src/mapred/org/apache/hadoop/mapreduce/security/token/DelegationTokenRenewal.java
Date Fri, 05 Jul 2013 03:01:55 GMT
Author: acmurthy
Date: Fri Jul  5 03:01:54 2013
New Revision: 1499899

URL: http://svn.apache.org/r1499899
Log:
Merge -c 1499566 from branch-1 to branch-1.2 to fix MAPREDUCE-5364. Deadlock between RenewalTimerTask
methods cancel() and run(). (kkambatl via tucu)

Modified:
    hadoop/common/branches/branch-1.2/CHANGES.txt
    hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapreduce/security/token/DelegationTokenRenewal.java

Modified: hadoop/common/branches/branch-1.2/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.2/CHANGES.txt?rev=1499899&r1=1499898&r2=1499899&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.2/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1.2/CHANGES.txt Fri Jul  5 03:01:54 2013
@@ -1,5 +1,8 @@
 Hadoop Change Log
 
+    MAPREDUCE-5364. Deadlock between RenewalTimerTask methods cancel() and run(). 
+    (kkambatl via tucu)
+
 Release 1.2.1 - Unreleased 
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapreduce/security/token/DelegationTokenRenewal.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapreduce/security/token/DelegationTokenRenewal.java?rev=1499899&r1=1499898&r2=1499899&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapreduce/security/token/DelegationTokenRenewal.java
(original)
+++ hadoop/common/branches/branch-1.2/src/mapred/org/apache/hadoop/mapreduce/security/token/DelegationTokenRenewal.java
Fri Jul  5 03:01:54 2013
@@ -30,6 +30,7 @@ import java.util.Set;
 import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -200,13 +201,13 @@ public class DelegationTokenRenewal {
    */
   private static class RenewalTimerTask extends TimerTask {
     private DelegationTokenToRenew dttr;
-    private boolean cancelled = false;
+    private AtomicBoolean cancelled = new AtomicBoolean(false);
     
     RenewalTimerTask(DelegationTokenToRenew t) {  dttr = t;  }
     
     @Override
-    public synchronized void run() {
-      if (cancelled) {
+    public void run() {
+      if (cancelled.get()) {
         return;
       }
 
@@ -234,8 +235,8 @@ public class DelegationTokenRenewal {
     }
 
     @Override
-    public synchronized boolean cancel() {
-      cancelled = true;
+    public boolean cancel() {
+      cancelled.set(true);
       return super.cancel();
     }
   }



Mime
View raw message