zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject zookeeper git commit: ZOOKEEPER-2726 ZOOKEEPER-2693: Patch for introduces potential race condition
Date Thu, 16 Mar 2017 19:57:17 GMT
Repository: zookeeper
Updated Branches:
  refs/heads/master b4dded46f -> 0313a0e0b


ZOOKEEPER-2726 ZOOKEEPER-2693: Patch for introduces potential race condition

Synchronizing these methods prevents potential race conditions.

Author: Kyle Nusbaum <knusbaum@yahoo-inc.com>

Reviewers: Govind Menon, Kishor Patil <patik523@yahoo.com>, Michael Han <hanm@apache.org>

Closes #196 from knusbaum/ZOOKEEPER-2726-master


Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/0313a0e0
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/0313a0e0
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/0313a0e0

Branch: refs/heads/master
Commit: 0313a0e0b6c47b316271533165e5830d1ca04478
Parents: b4dded4
Author: Kyle Nusbaum <knusbaum@yahoo-inc.com>
Authored: Thu Mar 16 12:57:12 2017 -0700
Committer: Michael Han <hanm@apache.org>
Committed: Thu Mar 16 12:57:12 2017 -0700

----------------------------------------------------------------------
 .../org/apache/zookeeper/server/command/FourLetterCommands.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/0313a0e0/src/java/main/org/apache/zookeeper/server/command/FourLetterCommands.java
----------------------------------------------------------------------
diff --git a/src/java/main/org/apache/zookeeper/server/command/FourLetterCommands.java b/src/java/main/org/apache/zookeeper/server/command/FourLetterCommands.java
index 82e09dc..45bd942 100644
--- a/src/java/main/org/apache/zookeeper/server/command/FourLetterCommands.java
+++ b/src/java/main/org/apache/zookeeper/server/command/FourLetterCommands.java
@@ -169,7 +169,7 @@ public class FourLetterCommands {
     private static boolean whiteListInitialized = false;
 
     // @VisibleForTesting
-    public static void resetWhiteList() {
+    public synchronized static void resetWhiteList() {
         whiteListInitialized = false;
         whiteListedCommands.clear();
     }
@@ -202,7 +202,7 @@ public class FourLetterCommands {
      * @param command The command string.
      * @return true if the specified command is enabled
      */
-    public static boolean isEnabled(String command) {
+    public synchronized static boolean isEnabled(String command) {
         if (whiteListInitialized) {
             return whiteListedCommands.contains(command);
         }


Mime
View raw message