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 2018/09/07 00:49:22 UTC

zookeeper git commit: ZOOKEEPER-3136: Reduce log in ClientBase in case of ConnectException

Repository: zookeeper
Updated Branches:
  refs/heads/master 95557a30e -> 27db6bd28


ZOOKEEPER-3136: Reduce log in ClientBase in case of ConnectException

Do not log stacktraces of a very common error during the execution of tests, that is while waiting for a server to start.

Author: Enrico Olivelli <eo...@apache.org>

Reviewers: hanm, maoling

Closes #614 from eolivelli/fix/ZOOKEEPER-3136-noisy-log


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

Branch: refs/heads/master
Commit: 27db6bd28e3297cdafe19c204b42c3db20c45ad6
Parents: 95557a3
Author: Enrico Olivelli <eo...@apache.org>
Authored: Thu Sep 6 17:49:10 2018 -0700
Committer: Michael Han <ha...@apache.org>
Committed: Thu Sep 6 17:49:10 2018 -0700

----------------------------------------------------------------------
 src/java/test/org/apache/zookeeper/test/ClientBase.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/27db6bd2/src/java/test/org/apache/zookeeper/test/ClientBase.java
----------------------------------------------------------------------
diff --git a/src/java/test/org/apache/zookeeper/test/ClientBase.java b/src/java/test/org/apache/zookeeper/test/ClientBase.java
index a550098..4cb42ed 100644
--- a/src/java/test/org/apache/zookeeper/test/ClientBase.java
+++ b/src/java/test/org/apache/zookeeper/test/ClientBase.java
@@ -25,6 +25,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.net.ConnectException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
@@ -287,6 +288,9 @@ public abstract class ClientBase extends ZKTestCase {
                         !result.contains("READ-ONLY")) {
                     return true;
                 }
+            } catch (ConnectException e) {
+                // ignore as this is expected, do not log stacktrace
+                LOG.info("server {} not up: {}", hp, e.toString());
             } catch (IOException e) {
                 // ignore as this is expected
                 LOG.info("server {} not up", hp, e);