hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject svn commit: r1577591 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java
Date Fri, 14 Mar 2014 15:59:53 GMT
Author: jxiang
Date: Fri Mar 14 15:59:53 2014
New Revision: 1577591

URL: http://svn.apache.org/r1577591
Log:
HBASE-10745 Access ShutdownHook#fsShutdownHooks should be synchronized

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java?rev=1577591&r1=1577590&r2=1577591&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java
Fri Mar 14 15:59:53 2014
@@ -191,12 +191,12 @@ public class ShutdownHook {
       if (hdfsClientFinalizer == null) {
         throw new RuntimeException("Client finalizer is null, can't suppress!");
       }
-      if (!fsShutdownHooks.containsKey(hdfsClientFinalizer) &&
-          !ShutdownHookManager.deleteShutdownHook(hdfsClientFinalizer)) {
-        throw new RuntimeException("Failed suppression of fs shutdown hook: " +
-          hdfsClientFinalizer);
-      }
       synchronized (fsShutdownHooks) {
+        if (!fsShutdownHooks.containsKey(hdfsClientFinalizer) &&
+            !ShutdownHookManager.deleteShutdownHook(hdfsClientFinalizer)) {
+          throw new RuntimeException("Failed suppression of fs shutdown hook: " +
+            hdfsClientFinalizer);
+        }
         Integer refs = fsShutdownHooks.get(hdfsClientFinalizer);
         fsShutdownHooks.put(hdfsClientFinalizer, refs == null ? 1 : refs + 1);
       }



Mime
View raw message