You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by ha...@apache.org on 2017/03/16 19:57:17 UTC
zookeeper git commit: ZOOKEEPER-2726 ZOOKEEPER-2693: Patch for
introduces potential race condition
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 <kn...@yahoo-inc.com>
Reviewers: Govind Menon, Kishor Patil <pa...@yahoo.com>, Michael Han <ha...@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 <kn...@yahoo-inc.com>
Authored: Thu Mar 16 12:57:12 2017 -0700
Committer: Michael Han <ha...@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);
}