hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject svn commit: r1577589 - /hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java
Date Fri, 14 Mar 2014 15:57:10 GMT
Author: jxiang
Date: Fri Mar 14 15:57:09 2014
New Revision: 1577589

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

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

Modified: hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java?rev=1577589&r1=1577588&r2=1577589&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java
(original)
+++ hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java
Fri Mar 14 15:57:09 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