Skip to content

Commit

Permalink
ZOOKEEPER-1510. Should not log SASL errors for non-secure usage (Todd…
Browse files Browse the repository at this point in the history
… Lipcon via phunt) Missed a bit in the prior commit

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1368299 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
phunt committed Aug 1, 2012
1 parent 588ba1d commit 0ee77bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/java/main/org/apache/zookeeper/ClientCnxn.java
Original file line number Diff line number Diff line change
Expand Up @@ -952,15 +952,19 @@ private void startConnect() throws IOException {
Watcher.Event.EventType.None,
Watcher.Event.KeeperState.AuthFailed, null));
}
String log = "Opening socket connection to server " + addr;
if (zooKeeperSaslClient != null) {
log += ". " + zooKeeperSaslClient.getConfigStatus();
}
LOG.info(log);
logStartConnect(addr);

clientCnxnSocket.connect(addr);
}

private void logStartConnect(InetSocketAddress addr) {
String msg = "Opening socket connection to server " + addr;
if (zooKeeperSaslClient != null) {
msg += ". " + zooKeeperSaslClient.getConfigStatus();
}
LOG.info(msg);
}

private static final String RETRY_CONN_MSG =
", closing socket connection and attempting reconnect";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public enum SaslState {

private SaslState saslState = SaslState.INITIAL;

/** informational message indicating the current configuration status */
private final String configStatus;

public SaslState getSaslState() {
Expand Down Expand Up @@ -147,6 +148,9 @@ public ZooKeeperSaslClient(final String serverPrincipal)
}
}

/**
* @return informational message indicating the current configuration status.
*/
public String getConfigStatus() {
return configStatus;
}
Expand Down

0 comments on commit 0ee77bb

Please sign in to comment.