You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by mjeelanimsft <gi...@git.apache.org> on 2018/06/12 19:41:54 UTC
[GitHub] zookeeper pull request #542: [ZOOKEEPER-3060] Logging the server local port ...
GitHub user mjeelanimsft opened a pull request:
https://github.com/apache/zookeeper/pull/542
[ZOOKEEPER-3060] Logging the server local port to stderr
This simple straightforward patch adds logging of the server local port to stderr which aids in simplifying debugging if you want to have to look that up
ZKPatch: f478ca59e2d14d3a2d67321ad9086493d47c8661 (extract)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mjeelanimsft/zookeeper Logging-server-local-port-to-stderr
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zookeeper/pull/542.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 #542
----
commit 5a5853b3246092a349f502b4e871f541b717dd8b
Author: Jeelani Mohamed Abdul Khader <mj...@...>
Date: 2018-06-12T18:29:15Z
Logging the server local port to stderr
ZKPatch: f478ca59e2d14d3a2d67321ad9086493d47c8661 (extract)
----
---
[GitHub] zookeeper pull request #542: [ZOOKEEPER-3060] Logging the server local port ...
Posted by nkalmar <gi...@git.apache.org>.
Github user nkalmar commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/542#discussion_r196062698
--- Diff: src/java/main/org/apache/zookeeper/server/NIOServerCnxnFactory.java ---
@@ -686,6 +686,8 @@ public void configure(InetSocketAddress addr, int maxcc, boolean secure) throws
LOG.info("binding to port " + addr);
ss.socket().bind(addr);
ss.configureBlocking(false);
+ int port = ss.socket().getLocalPort();
+ LOG.info("bound to port " + port);
--- End diff --
Just a nitpick: why create a variable for the port?
---
[GitHub] zookeeper issue #542: [ZOOKEEPER-3060] Logging the server local port to stde...
Posted by lvfangmin <gi...@git.apache.org>.
Github user lvfangmin commented on the issue:
https://github.com/apache/zookeeper/pull/542
This is only useful when we don't use 0 as the port in the address, which won't happen in realistic for prod usage, so it's not that meaningful to have this patch.
@mjeelanimsft we only use it internally for testing purpose, should consider to abandon this patch.
---
[GitHub] zookeeper pull request #542: [ZOOKEEPER-3060] Logging the server local port ...
Posted by mjeelanimsft <gi...@git.apache.org>.
Github user mjeelanimsft closed the pull request at:
https://github.com/apache/zookeeper/pull/542
---