hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject svn commit: r1577588 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java
Date Fri, 14 Mar 2014 15:56:43 GMT
Author: jxiang
Date: Fri Mar 14 15:56:43 2014
New Revision: 1577588

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

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java?rev=1577588&r1=1577587&r2=1577588&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java
Fri Mar 14 15:56:43 2014
@@ -198,12 +198,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