zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cnaur...@apache.org
Subject svn commit: r1733679 - in /zookeeper/trunk: CHANGES.txt src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
Date Sat, 05 Mar 2016 00:03:58 GMT
Author: cnauroth
Date: Sat Mar  5 00:03:57 2016
New Revision: 1733679

URL: http://svn.apache.org/viewvc?rev=1733679&view=rev
Log:
ZOOKEEPER-2379: recent commit broke findbugs qabot check (rakeshr via cnauroth)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1733679&r1=1733678&r2=1733679&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Sat Mar  5 00:03:57 2016
@@ -257,6 +257,9 @@ BUGFIXES:
   ZOOKEEPER-2375: Prevent multiple initialization of login object in each
   ZooKeeperSaslClient instance (yuemeng via rakeshr)
 
+  ZOOKEEPER-2379: recent commit broke findbugs qabot check
+  (rakeshr via cnauroth)
+
 IMPROVEMENTS:
   ZOOKEEPER-1660 Documentation for Dynamic Reconfiguration (Reed Wanderman-Milne via shralex)
 
 

Modified: zookeeper/trunk/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java?rev=1733679&r1=1733678&r2=1733679&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java Sat
Mar  5 00:03:57 2016
@@ -64,6 +64,7 @@ public class ZooKeeperSaslClient {
     public static final String LOGIN_CONTEXT_NAME_KEY = "zookeeper.sasl.clientconfig";
     public static final String ENABLE_CLIENT_SASL_KEY = "zookeeper.sasl.client";
     public static final String ENABLE_CLIENT_SASL_DEFAULT = "true";
+    private static volatile boolean initializedLogin = false; 
 
     /**
      * Returns true if the SASL client is enabled. By default, the client
@@ -217,7 +218,7 @@ public class ZooKeeperSaslClient {
     private SaslClient createSaslClient(final String servicePrincipal,
                                                      final String loginContext) throws LoginException
{
         try {
-            if (login == null) {
+            if (!initializedLogin) {
                 synchronized (ZooKeeperSaslClient.class) {
                     if (login == null) {
                         if (LOG.isDebugEnabled()) {
@@ -227,6 +228,7 @@ public class ZooKeeperSaslClient {
                         // in order to ensure the login is initialized only once, it must
be synchronized the code snippet.
                         login = new Login(loginContext, new ClientCallbackHandler(null));
                         login.startThreadIfNeeded();
+                        initializedLogin = true;
                     }
                 }
             }



Mime
View raw message