[GitHub] zookeeper pull request #614: ZOOKEEPER-3136 Reduce log in ClientBase in case...

2018-08-31 Thread eolivelli
GitHub user eolivelli opened a pull request:

https://github.com/apache/zookeeper/pull/614

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.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/eolivelli/zookeeper 
fix/ZOOKEEPER-3136-noisy-log

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/zookeeper/pull/614.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #614


commit 3e1fe86de944edb97bc560c116be2e32bbadee1b
Author: Enrico Olivelli 
Date:   2018-08-31T22:42:05Z

ZOOKEEPER-3136 Reduce log in ClientBase in case of ConnectException




---


[GitHub] zookeeper pull request #614: ZOOKEEPER-3136 Reduce log in ClientBase in case...

2018-09-01 Thread maoling
Github user maoling commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/614#discussion_r214506993
  
--- Diff: src/java/test/org/apache/zookeeper/test/ClientBase.java ---
@@ -287,6 +288,9 @@ public static boolean waitForServerUp(String hp, long 
timeout, boolean secure) {
 !result.contains("READ-ONLY")) {
 return true;
 }
+} catch (ConnectException e) {
+// ignore as this is expected, do not log stacktrace
+LOG.info("server {} not up", hp);
 } catch (IOException e) {
--- End diff --

If printing the stacktraces is not very useful and annoying, Adding 
`e.getMessage()` just to tell us what type of exception has happened is better?


---


[GitHub] zookeeper pull request #614: ZOOKEEPER-3136 Reduce log in ClientBase in case...

2018-09-01 Thread eolivelli
Github user eolivelli commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/614#discussion_r214507696
  
--- Diff: src/java/test/org/apache/zookeeper/test/ClientBase.java ---
@@ -287,6 +288,9 @@ public static boolean waitForServerUp(String hp, long 
timeout, boolean secure) {
 !result.contains("READ-ONLY")) {
 return true;
 }
+} catch (ConnectException e) {
+// ignore as this is expected, do not log stacktrace
+LOG.info("server {} not up", hp);
 } catch (IOException e) {
--- End diff --

Good idea, I will log e.toString(), this will provide class name as well


---


[GitHub] zookeeper pull request #614: ZOOKEEPER-3136 Reduce log in ClientBase in case...

2018-09-06 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/zookeeper/pull/614


---