[jira] [Commented] (ZOOKEEPER-2642) ZOOKEEPER-2014 breaks existing clients for little benefit

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823534#comment-15823534
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2642:
---

Github user hanm commented on the issue:

https://github.com/apache/zookeeper/pull/122
  
I think this patch is ready to land... @fpj What do you think?


> ZOOKEEPER-2014 breaks existing clients for little benefit
> -
>
> Key: ZOOKEEPER-2642
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2642
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: c client, java client
>Affects Versions: 3.5.2
>Reporter: Jordan Zimmerman
>Assignee: Jordan Zimmerman
>Priority: Blocker
> Fix For: 3.5.3, 3.6.0
>
> Attachments: ZOOKEEPER-2642.patch, ZOOKEEPER-2642.patch, 
> ZOOKEEPER-2642.patch, ZOOKEEPER-2642.patch, ZOOKEEPER-2642.patch, 
> ZOOKEEPER-2642.patch
>
>
> ZOOKEEPER-2014 moved the reconfig() methods into a new class, ZooKeeperAdmin. 
> It appears this was done to document that these are methods have access 
> restrictions. However, this change breaks Apache Curator (and possibly other 
> clients). Curator APIs will have to be changed and/or special methods need to 
> be added. A breaking change of this kind should only be done when the benefit 
> is overwhelming. In this case, the same information can be conveyed with 
> documentation and possibly a deprecation notice.
> Revert the creation of the ZooKeeperAdmin class and move the reconfig() 
> methods back to the ZooKeeper class with additional documentation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] zookeeper issue #122: [ZOOKEEPER-2642] Resurrect the reconfig() methods that...

2017-01-15 Thread hanm
Github user hanm commented on the issue:

https://github.com/apache/zookeeper/pull/122
  
I think this patch is ready to land... @fpj What do you think?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Resolved] (ZOOKEEPER-1846) Cached InetSocketAddresses prevent proper dynamic DNS resolution

2017-01-15 Thread Michael Han (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Han resolved ZOOKEEPER-1846.

Resolution: Duplicate

I am pretty sure this is a duplicate of ZOOKEEPER-1506; resolve as dup.

> Cached InetSocketAddresses prevent proper dynamic DNS resolution
> 
>
> Key: ZOOKEEPER-1846
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1846
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: quorum
>Affects Versions: 3.4.6
>Reporter: Benjamin Jaton
>Priority: Minor
>  Labels: patch
> Attachments: DynamicIP.java.patch, Learner.java, 
> QuorumCnxManager.java, QuorumPeer.java
>
>
> The class QuorumPeer maintains a Map quorumPeers.
> Each QuorumServer is created with an instance of InetSocketAddress 
> electionAddr, and holds it forever.
> I believe this is why the ZooKeeper servers can't resolve each other 
> dynamically: If a ZooKeeper in the ensemble cannot be resolved at startup, it 
> will never be resolved (until restart of the JVM), constantly failing with an 
> UnknownHostException, even when the node is back up and reachable.
> I would suggest to recreate an InetSocketAddress every time we retry the 
> connection.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (ZOOKEEPER-2184) Zookeeper Client should re-resolve hosts when connection attempts fail

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823528#comment-15823528
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2184:
---

Github user hanm commented on the issue:

https://github.com/apache/zookeeper/pull/150
  
Does C client has similar issue?

Also, ZOOKEEPER-2184 looks like a dup of ZOOKEEPER-338.


> Zookeeper Client should re-resolve hosts when connection attempts fail
> --
>
> Key: ZOOKEEPER-2184
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2184
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: java client
>Affects Versions: 3.4.6, 3.5.0
> Environment: Ubuntu 14.04 host, Docker containers for Zookeeper & 
> Kafka
>Reporter: Robert P. Thille
>Assignee: Robert P. Thille
>  Labels: easyfix, patch
> Fix For: 3.4.10, 3.5.3
>
> Attachments: ZOOKEEPER-2184.patch
>
>
> Testing in a Docker environment with a single Kafka instance using a single 
> Zookeeper instance. Restarting the Zookeeper container will cause it to 
> receive a new IP address. Kafka will never be able to reconnect to Zookeeper 
> and will hang indefinitely. Updating DNS or /etc/hosts with the new IP 
> address will not help the client to reconnect as the 
> zookeeper/client/StaticHostProvider resolves the connection string hosts at 
> creation time and never re-resolves.
> A solution would be for the client to notice that connection attempts fail 
> and attempt to re-resolve the hostnames in the connectString.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] zookeeper issue #150: ZOOKEEPER-2184: Zookeeper Client should re-resolve hos...

2017-01-15 Thread hanm
Github user hanm commented on the issue:

https://github.com/apache/zookeeper/pull/150
  
Does C client has similar issue?

Also, ZOOKEEPER-2184 looks like a dup of ZOOKEEPER-338.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #150: ZOOKEEPER-2184: Zookeeper Client should re-reso...

2017-01-15 Thread hanm
Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/150#discussion_r96170084
  
--- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java 
---
@@ -87,15 +73,69 @@ public StaticHostProvider(Collection 
serverAddresses)
 Collections.shuffle(this.serverAddresses);
 }
 
+/**
+ * In Java 7, we have a method getHostString, but earlier versions do 
not support it.
+ * This method is to provide a replacement for 
InetSocketAddress.getHostString().
+ *
+ * It evaluates to a hostname if one is available and otherwise it 
returns the
+ * string representation of the IP address.
+ *
+ * @param addr
+ * @return Hostname string of address parameter
+ */
+private String getHostString(InetSocketAddress addr) {
--- End diff --

Java 6 has getHostString, but it's package private. Use reflection can 
access that. Maybe we should use the library version instead?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-2184) Zookeeper Client should re-resolve hosts when connection attempts fail

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823525#comment-15823525
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2184:
---

Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/150#discussion_r96170084
  
--- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java 
---
@@ -87,15 +73,69 @@ public StaticHostProvider(Collection 
serverAddresses)
 Collections.shuffle(this.serverAddresses);
 }
 
+/**
+ * In Java 7, we have a method getHostString, but earlier versions do 
not support it.
+ * This method is to provide a replacement for 
InetSocketAddress.getHostString().
+ *
+ * It evaluates to a hostname if one is available and otherwise it 
returns the
+ * string representation of the IP address.
+ *
+ * @param addr
+ * @return Hostname string of address parameter
+ */
+private String getHostString(InetSocketAddress addr) {
--- End diff --

Java 6 has getHostString, but it's package private. Use reflection can 
access that. Maybe we should use the library version instead?


> Zookeeper Client should re-resolve hosts when connection attempts fail
> --
>
> Key: ZOOKEEPER-2184
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2184
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: java client
>Affects Versions: 3.4.6, 3.5.0
> Environment: Ubuntu 14.04 host, Docker containers for Zookeeper & 
> Kafka
>Reporter: Robert P. Thille
>Assignee: Robert P. Thille
>  Labels: easyfix, patch
> Fix For: 3.4.10, 3.5.3
>
> Attachments: ZOOKEEPER-2184.patch
>
>
> Testing in a Docker environment with a single Kafka instance using a single 
> Zookeeper instance. Restarting the Zookeeper container will cause it to 
> receive a new IP address. Kafka will never be able to reconnect to Zookeeper 
> and will hang indefinitely. Updating DNS or /etc/hosts with the new IP 
> address will not help the client to reconnect as the 
> zookeeper/client/StaticHostProvider resolves the connection string hosts at 
> creation time and never re-resolves.
> A solution would be for the client to notice that connection attempts fail 
> and attempt to re-resolve the hostnames in the connectString.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (ZOOKEEPER-2184) Zookeeper Client should re-resolve hosts when connection attempts fail

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823523#comment-15823523
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2184:
---

Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/150#discussion_r96170041
  
--- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java 
---
@@ -87,15 +73,69 @@ public StaticHostProvider(Collection 
serverAddresses)
 Collections.shuffle(this.serverAddresses);
 }
 
+/**
+ * In Java 7, we have a method getHostString, but earlier versions do 
not support it.
+ * This method is to provide a replacement for 
InetSocketAddress.getHostString().
+ *
+ * It evaluates to a hostname if one is available and otherwise it 
returns the
+ * string representation of the IP address.
+ *
+ * @param addr
+ * @return Hostname string of address parameter
+ */
+private String getHostString(InetSocketAddress addr) {
+String hostString;
+InetAddress ia = addr.getAddress();
+
+if (ia != null) {
+// If the string starts with '/', then it has no hostname
+// and we want to avoid the reverse lookup, so we return
+// the string representation of the address.
+if (ia.toString().startsWith("/")) {
+hostString = ia.getHostAddress();
+} else {
+hostString = addr.getHostName();
+}
+} else {
+// According to the Java 6 documentation, if the hostname is
+// unresolved, then the string before the colon is the 
hostname.
+String addrString = addr.toString();
+hostString = addrString.substring(0, 
addrString.lastIndexOf(':'));
+}
+
+return hostString;
+}
+
 public int size() {
 return serverAddresses.size();
 }
 
 public InetSocketAddress next(long spinDelay) {
-++currentIndex;
-if (currentIndex == serverAddresses.size()) {
-currentIndex = 0;
+// Handle possible connection error by re-resolving hostname if 
possible
+if (!connectedSinceNext) {
+InetSocketAddress curAddr = serverAddresses.get(currentIndex);
+if 
(!curAddr.getHostString().equals(curAddr.getAddress().getHostAddress())) {
+try {
+int thePort = curAddr.getPort();
+InetAddress resolvedAddresses[] = 
InetAddress.getAllByName(getHostString(curAddr));
+if (resolvedAddresses.length == 1) {
+serverAddresses.set(currentIndex, new 
InetSocketAddress(resolvedAddresses[0], thePort));
+} else {
+serverAddresses.remove(currentIndex);
+for (InetAddress resolvedAddress : 
resolvedAddresses) {
+InetSocketAddress newAddr = new 
InetSocketAddress(resolvedAddress, thePort);
+if (!serverAddresses.contains(newAddr)) {
+serverAddresses.add(newAddr);
+}
+}
+}
+} catch (UnknownHostException e) {
+LOG.warn("Cannot re-resolve server: " + curAddr + " 
UnknownHostException: " + e);
--- End diff --

Should we create an unresolved address like what we did on server side 
`recreateSocketAddresses` if we can't resolve the address? If the address is 
not resolvable but maybe it is still usable?


> Zookeeper Client should re-resolve hosts when connection attempts fail
> --
>
> Key: ZOOKEEPER-2184
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2184
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: java client
>Affects Versions: 3.4.6, 3.5.0
> Environment: Ubuntu 14.04 host, Docker containers for Zookeeper & 
> Kafka
>Reporter: Robert P. Thille
>Assignee: Robert P. Thille
>  Labels: easyfix, patch
> Fix For: 3.4.10, 3.5.3
>
> Attachments: ZOOKEEPER-2184.patch
>
>
> Testing in a Docker environment with a single Kafka instance using a single 
> Zookeeper instance. Restarting the Zookeeper container will cause it to 
> receive a new IP address. Kafka will never be able to reconnect to Zookeeper 
> and will hang indefinitely. Updating DNS or /etc/hosts with the new IP 
> address will not help the client to reconnect as the 
> 

[GitHub] zookeeper pull request #150: ZOOKEEPER-2184: Zookeeper Client should re-reso...

2017-01-15 Thread hanm
Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/150#discussion_r96170041
  
--- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java 
---
@@ -87,15 +73,69 @@ public StaticHostProvider(Collection 
serverAddresses)
 Collections.shuffle(this.serverAddresses);
 }
 
+/**
+ * In Java 7, we have a method getHostString, but earlier versions do 
not support it.
+ * This method is to provide a replacement for 
InetSocketAddress.getHostString().
+ *
+ * It evaluates to a hostname if one is available and otherwise it 
returns the
+ * string representation of the IP address.
+ *
+ * @param addr
+ * @return Hostname string of address parameter
+ */
+private String getHostString(InetSocketAddress addr) {
+String hostString;
+InetAddress ia = addr.getAddress();
+
+if (ia != null) {
+// If the string starts with '/', then it has no hostname
+// and we want to avoid the reverse lookup, so we return
+// the string representation of the address.
+if (ia.toString().startsWith("/")) {
+hostString = ia.getHostAddress();
+} else {
+hostString = addr.getHostName();
+}
+} else {
+// According to the Java 6 documentation, if the hostname is
+// unresolved, then the string before the colon is the 
hostname.
+String addrString = addr.toString();
+hostString = addrString.substring(0, 
addrString.lastIndexOf(':'));
+}
+
+return hostString;
+}
+
 public int size() {
 return serverAddresses.size();
 }
 
 public InetSocketAddress next(long spinDelay) {
-++currentIndex;
-if (currentIndex == serverAddresses.size()) {
-currentIndex = 0;
+// Handle possible connection error by re-resolving hostname if 
possible
+if (!connectedSinceNext) {
+InetSocketAddress curAddr = serverAddresses.get(currentIndex);
+if 
(!curAddr.getHostString().equals(curAddr.getAddress().getHostAddress())) {
+try {
+int thePort = curAddr.getPort();
+InetAddress resolvedAddresses[] = 
InetAddress.getAllByName(getHostString(curAddr));
+if (resolvedAddresses.length == 1) {
+serverAddresses.set(currentIndex, new 
InetSocketAddress(resolvedAddresses[0], thePort));
+} else {
+serverAddresses.remove(currentIndex);
+for (InetAddress resolvedAddress : 
resolvedAddresses) {
+InetSocketAddress newAddr = new 
InetSocketAddress(resolvedAddress, thePort);
+if (!serverAddresses.contains(newAddr)) {
+serverAddresses.add(newAddr);
+}
+}
+}
+} catch (UnknownHostException e) {
+LOG.warn("Cannot re-resolve server: " + curAddr + " 
UnknownHostException: " + e);
--- End diff --

Should we create an unresolved address like what we did on server side 
`recreateSocketAddresses` if we can't resolve the address? If the address is 
not resolvable but maybe it is still usable?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Created] (ZOOKEEPER-2666) the watch function called many times when it should be called once

2017-01-15 Thread ZHE CHEN (JIRA)
ZHE CHEN created ZOOKEEPER-2666:
---

 Summary: the watch function called many times when it should be 
called once
 Key: ZOOKEEPER-2666
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2666
 Project: ZooKeeper
  Issue Type: Bug
  Components: c client, server
Affects Versions: 3.4.5
 Environment: ubuntu 14.04
zookeeper 3.4.5, it's installed by apt-get
Reporter: ZHE CHEN


We have a service A, which has 2 instances A1 and A2. 
We also have another 2 services, B and C. B has 2 instances B1 and B2. C has 2 
instances C1 and C2.

A1 and A2 both register child watch for B and C. 2 individual watches, of 
course.

I restart B1 and C1 nearly at the same time. Then, theoretically A1 and A2 
both should receive 2 events about the child change of service B and C.
However, the real result is, A1 received the 2 children changes of service B 
and C separately, A2 only received the children change of service B. Moreover, 
A2 got the children change of service B many many times when service B only 
changed once at that time (I add auto re-registration so A2 can receive the 
event more than once).

Till now, it only happened once. If it happens again, maybe I will provide some 
logs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: ZooKeeper 3.4.10 release discussion

2017-01-15 Thread Rakesh Radhakrishnan
Thanks for pointing this jira. I will take a look at this.

Rakesh

On Fri, Jan 13, 2017 at 7:27 PM, Edward Ribeiro 
wrote:

> Hi Rakesh,
>
> Thansk for stepping up to this task! Pretty cool! :)
>
> Do you think https://issues.apache.org/jira/browse/ZOOKEEPER-2573 is worth
> targeting 3.4.10 too?
>
> Edward
>
>
>
> On Fri, Jan 13, 2017 at 7:56 AM, Rakesh Radhakrishnan 
> wrote:
>
> > Hi All,
> >
> > I hope to cut an RC in a week - giving some more time for your favorite
> > outstanding blocker/critical issues. Will start moving out any tickets
> that
> > are not blockers and/or won’t fit the timeline - there are 1 blocker, 5
> > critical, 15 major, 7 minor tickets outstanding as of now. Appreciate
> your
> > support in releasing 3.4.10 version. Thanks!
> >
> > Please find the open issues marked for 3.4.10 release here,
> > https://goo.gl/XdraFA
> >
> > Thanks,
> > Rakesh
> >
> >
> > On Tue, Dec 6, 2016 at 4:15 PM, Rakesh Radhakrishnan  >
> > wrote:
> >
> > > Hi All,
> > >
> > > I am interested in going through the release process as the RM.
> > >
> > > Overall, I could see total 41 issues marked for 3.4.10 release as of
> now,
> > > which includes 4 blockers, 5 critical, 20 major and 12 minor issues. I
> > > count 9 issues fixed/committed already for 3.4.10 which includes 1
> > blocker
> > > and 1 critical(security related) issue. ZOOKEEPER-1045 is a much
> awaited
> > > one and the feature code is committed. I think it is a good time to
> > > initiate the discussion of 3.4.10 release processes.
> > >
> > > Please find the issues marked for 3.4.10 release here,
> > > https://goo.gl/FfbpVG
> > >
> > > Currently, I'm focusing on updating ZOOKEEPER-1045 feature details into
> > > our project cwiki and related ZOOKEEPER-2479 improvement jira. I'd like
> > to
> > > include ZOOKEEPER-2383 into this release if everyone agrees. Appreciate
> > > your help in reviewing the jira patches and making it stable for
> release.
> > > Also, please feel free to push your favorite issues ahead of 3.4.10
> > release.
> > >
> > > I hope with the community support, we should be able to close all
> > > necessary blockers/critical issues soon. Kindly requesting everyone to
> > look
> > > at the issues marked for 3.4.10 and push these asap or can be pushed
> out
> > to
> > > 3.4.11.
> > >
> > > Imp: Since we moved to github repository, the release procedure
> > > https://cwiki.apache.org/confluence/display/ZOOKEEPER/HowToRelease
> > > requires changes. Appreciate your help in this part. Thanks!
> > >
> > > Please let me know your thoughts on the plan.
> > >
> > > Thanks,
> > > Rakesh
> > >
> >
>


[jira] [Commented] (ZOOKEEPER-2184) Zookeeper Client should re-resolve hosts when connection attempts fail

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823445#comment-15823445
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2184:
---

Github user rakeshadr commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/150#discussion_r96163423
  
--- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java 
---
@@ -87,15 +73,69 @@ public StaticHostProvider(Collection 
serverAddresses)
 Collections.shuffle(this.serverAddresses);
 }
 
+/**
+ * In Java 7, we have a method getHostString, but earlier versions do 
not support it.
+ * This method is to provide a replacement for 
InetSocketAddress.getHostString().
+ *
+ * It evaluates to a hostname if one is available and otherwise it 
returns the
+ * string representation of the IP address.
+ *
+ * @param addr
+ * @return Hostname string of address parameter
+ */
+private String getHostString(InetSocketAddress addr) {
+String hostString;
+InetAddress ia = addr.getAddress();
+
+if (ia != null) {
+// If the string starts with '/', then it has no hostname
+// and we want to avoid the reverse lookup, so we return
+// the string representation of the address.
+if (ia.toString().startsWith("/")) {
+hostString = ia.getHostAddress();
+} else {
+hostString = addr.getHostName();
+}
+} else {
+// According to the Java 6 documentation, if the hostname is
+// unresolved, then the string before the colon is the 
hostname.
+String addrString = addr.toString();
+hostString = addrString.substring(0, 
addrString.lastIndexOf(':'));
+}
+
+return hostString;
+}
+
 public int size() {
 return serverAddresses.size();
 }
 
 public InetSocketAddress next(long spinDelay) {
-++currentIndex;
-if (currentIndex == serverAddresses.size()) {
-currentIndex = 0;
+// Handle possible connection error by re-resolving hostname if 
possible
+if (!connectedSinceNext) {
+InetSocketAddress curAddr = serverAddresses.get(currentIndex);
+if 
(!curAddr.getHostString().equals(curAddr.getAddress().getHostAddress())) {
+try {
+int thePort = curAddr.getPort();
+InetAddress resolvedAddresses[] = 
InetAddress.getAllByName(getHostString(curAddr));
+if (resolvedAddresses.length == 1) {
+serverAddresses.set(currentIndex, new 
InetSocketAddress(resolvedAddresses[0], thePort));
+} else {
+serverAddresses.remove(currentIndex);
+for (InetAddress resolvedAddress : 
resolvedAddresses) {
+InetSocketAddress newAddr = new 
InetSocketAddress(resolvedAddress, thePort);
+if (!serverAddresses.contains(newAddr)) {
+serverAddresses.add(newAddr);
+}
+}
+}
+} catch (UnknownHostException e) {
+LOG.warn("Cannot re-resolve server: " + curAddr + " 
UnknownHostException: " + e);
--- End diff --

Please use {} instead of string concatenation. Also, for better debugging, 
can we pass 'e' object as argument to the logger instead of concat the 
exception message.


> Zookeeper Client should re-resolve hosts when connection attempts fail
> --
>
> Key: ZOOKEEPER-2184
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2184
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: java client
>Affects Versions: 3.4.6, 3.5.0
> Environment: Ubuntu 14.04 host, Docker containers for Zookeeper & 
> Kafka
>Reporter: Robert P. Thille
>Assignee: Robert P. Thille
>  Labels: easyfix, patch
> Fix For: 3.4.10, 3.5.3
>
> Attachments: ZOOKEEPER-2184.patch
>
>
> Testing in a Docker environment with a single Kafka instance using a single 
> Zookeeper instance. Restarting the Zookeeper container will cause it to 
> receive a new IP address. Kafka will never be able to reconnect to Zookeeper 
> and will hang indefinitely. Updating DNS or /etc/hosts with the new IP 
> address will not help the client to reconnect as the 
> 

[jira] [Commented] (ZOOKEEPER-2184) Zookeeper Client should re-resolve hosts when connection attempts fail

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823446#comment-15823446
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2184:
---

Github user rakeshadr commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/150#discussion_r96163440
  
--- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java 
---
@@ -87,15 +73,69 @@ public StaticHostProvider(Collection 
serverAddresses)
 Collections.shuffle(this.serverAddresses);
 }
 
+/**
+ * In Java 7, we have a method getHostString, but earlier versions do 
not support it.
+ * This method is to provide a replacement for 
InetSocketAddress.getHostString().
+ *
+ * It evaluates to a hostname if one is available and otherwise it 
returns the
+ * string representation of the IP address.
+ *
+ * @param addr
+ * @return Hostname string of address parameter
+ */
+private String getHostString(InetSocketAddress addr) {
+String hostString;
+InetAddress ia = addr.getAddress();
+
+if (ia != null) {
+// If the string starts with '/', then it has no hostname
+// and we want to avoid the reverse lookup, so we return
+// the string representation of the address.
+if (ia.toString().startsWith("/")) {
+hostString = ia.getHostAddress();
+} else {
+hostString = addr.getHostName();
+}
+} else {
+// According to the Java 6 documentation, if the hostname is
+// unresolved, then the string before the colon is the 
hostname.
+String addrString = addr.toString();
+hostString = addrString.substring(0, 
addrString.lastIndexOf(':'));
+}
+
+return hostString;
+}
+
 public int size() {
 return serverAddresses.size();
 }
 
 public InetSocketAddress next(long spinDelay) {
-++currentIndex;
-if (currentIndex == serverAddresses.size()) {
-currentIndex = 0;
+// Handle possible connection error by re-resolving hostname if 
possible
+if (!connectedSinceNext) {
+InetSocketAddress curAddr = serverAddresses.get(currentIndex);
+if 
(!curAddr.getHostString().equals(curAddr.getAddress().getHostAddress())) {
+try {
+int thePort = curAddr.getPort();
--- End diff --

I failed to find any test case which covers the newly added condition, 
could you please point me to that. Thanks!


> Zookeeper Client should re-resolve hosts when connection attempts fail
> --
>
> Key: ZOOKEEPER-2184
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2184
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: java client
>Affects Versions: 3.4.6, 3.5.0
> Environment: Ubuntu 14.04 host, Docker containers for Zookeeper & 
> Kafka
>Reporter: Robert P. Thille
>Assignee: Robert P. Thille
>  Labels: easyfix, patch
> Fix For: 3.4.10, 3.5.3
>
> Attachments: ZOOKEEPER-2184.patch
>
>
> Testing in a Docker environment with a single Kafka instance using a single 
> Zookeeper instance. Restarting the Zookeeper container will cause it to 
> receive a new IP address. Kafka will never be able to reconnect to Zookeeper 
> and will hang indefinitely. Updating DNS or /etc/hosts with the new IP 
> address will not help the client to reconnect as the 
> zookeeper/client/StaticHostProvider resolves the connection string hosts at 
> creation time and never re-resolves.
> A solution would be for the client to notice that connection attempts fail 
> and attempt to re-resolve the hostnames in the connectString.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] zookeeper pull request #150: ZOOKEEPER-2184: Zookeeper Client should re-reso...

2017-01-15 Thread rakeshadr
Github user rakeshadr commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/150#discussion_r96163440
  
--- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java 
---
@@ -87,15 +73,69 @@ public StaticHostProvider(Collection 
serverAddresses)
 Collections.shuffle(this.serverAddresses);
 }
 
+/**
+ * In Java 7, we have a method getHostString, but earlier versions do 
not support it.
+ * This method is to provide a replacement for 
InetSocketAddress.getHostString().
+ *
+ * It evaluates to a hostname if one is available and otherwise it 
returns the
+ * string representation of the IP address.
+ *
+ * @param addr
+ * @return Hostname string of address parameter
+ */
+private String getHostString(InetSocketAddress addr) {
+String hostString;
+InetAddress ia = addr.getAddress();
+
+if (ia != null) {
+// If the string starts with '/', then it has no hostname
+// and we want to avoid the reverse lookup, so we return
+// the string representation of the address.
+if (ia.toString().startsWith("/")) {
+hostString = ia.getHostAddress();
+} else {
+hostString = addr.getHostName();
+}
+} else {
+// According to the Java 6 documentation, if the hostname is
+// unresolved, then the string before the colon is the 
hostname.
+String addrString = addr.toString();
+hostString = addrString.substring(0, 
addrString.lastIndexOf(':'));
+}
+
+return hostString;
+}
+
 public int size() {
 return serverAddresses.size();
 }
 
 public InetSocketAddress next(long spinDelay) {
-++currentIndex;
-if (currentIndex == serverAddresses.size()) {
-currentIndex = 0;
+// Handle possible connection error by re-resolving hostname if 
possible
+if (!connectedSinceNext) {
+InetSocketAddress curAddr = serverAddresses.get(currentIndex);
+if 
(!curAddr.getHostString().equals(curAddr.getAddress().getHostAddress())) {
+try {
+int thePort = curAddr.getPort();
--- End diff --

I failed to find any test case which covers the newly added condition, 
could you please point me to that. Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #150: ZOOKEEPER-2184: Zookeeper Client should re-reso...

2017-01-15 Thread rakeshadr
Github user rakeshadr commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/150#discussion_r96163423
  
--- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java 
---
@@ -87,15 +73,69 @@ public StaticHostProvider(Collection 
serverAddresses)
 Collections.shuffle(this.serverAddresses);
 }
 
+/**
+ * In Java 7, we have a method getHostString, but earlier versions do 
not support it.
+ * This method is to provide a replacement for 
InetSocketAddress.getHostString().
+ *
+ * It evaluates to a hostname if one is available and otherwise it 
returns the
+ * string representation of the IP address.
+ *
+ * @param addr
+ * @return Hostname string of address parameter
+ */
+private String getHostString(InetSocketAddress addr) {
+String hostString;
+InetAddress ia = addr.getAddress();
+
+if (ia != null) {
+// If the string starts with '/', then it has no hostname
+// and we want to avoid the reverse lookup, so we return
+// the string representation of the address.
+if (ia.toString().startsWith("/")) {
+hostString = ia.getHostAddress();
+} else {
+hostString = addr.getHostName();
+}
+} else {
+// According to the Java 6 documentation, if the hostname is
+// unresolved, then the string before the colon is the 
hostname.
+String addrString = addr.toString();
+hostString = addrString.substring(0, 
addrString.lastIndexOf(':'));
+}
+
+return hostString;
+}
+
 public int size() {
 return serverAddresses.size();
 }
 
 public InetSocketAddress next(long spinDelay) {
-++currentIndex;
-if (currentIndex == serverAddresses.size()) {
-currentIndex = 0;
+// Handle possible connection error by re-resolving hostname if 
possible
+if (!connectedSinceNext) {
+InetSocketAddress curAddr = serverAddresses.get(currentIndex);
+if 
(!curAddr.getHostString().equals(curAddr.getAddress().getHostAddress())) {
+try {
+int thePort = curAddr.getPort();
+InetAddress resolvedAddresses[] = 
InetAddress.getAllByName(getHostString(curAddr));
+if (resolvedAddresses.length == 1) {
+serverAddresses.set(currentIndex, new 
InetSocketAddress(resolvedAddresses[0], thePort));
+} else {
+serverAddresses.remove(currentIndex);
+for (InetAddress resolvedAddress : 
resolvedAddresses) {
+InetSocketAddress newAddr = new 
InetSocketAddress(resolvedAddress, thePort);
+if (!serverAddresses.contains(newAddr)) {
+serverAddresses.add(newAddr);
+}
+}
+}
+} catch (UnknownHostException e) {
+LOG.warn("Cannot re-resolve server: " + curAddr + " 
UnknownHostException: " + e);
--- End diff --

Please use {} instead of string concatenation. Also, for better debugging, 
can we pass 'e' object as argument to the logger instead of concat the 
exception message.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Comment Edited] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread Matt Sicker (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823404#comment-15823404
 ] 

Matt Sicker edited comment on ZOOKEEPER-2659 at 1/16/17 3:33 AM:
-

I added several comments on the PR that didn't get cross-posted here.

Edit: that's because I have no idea how to use GitHub apparently. Fixed.


was (Author: jvz):
I added several comments on the PR that didn't get cross-posted here.

> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] zookeeper pull request #148: ZOOKEEPER-2659 Log4j 2 migration

2017-01-15 Thread jvz
Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145164
  
--- Diff: conf/log4j2.xml ---
@@ -0,0 +1,56 @@
+
+
+
--- End diff --

Not sure why you're using strict mode here. You're not using the right XML 
elements for strict mode. See the 
[docs](http://logging.apache.org/log4j/2.x/manual/configuration.html#Strict_XML).
 It'd be simpler to just remove the strict attribute as it's not the same type 
of strict as JS or Perl, for example (it's mainly useful for XSD validation).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #148: ZOOKEEPER-2659 Log4j 2 migration

2017-01-15 Thread jvz
Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145218
  
--- Diff: conf/log4j2.xml ---
@@ -0,0 +1,56 @@
+
+
+
+  
+%d{ISO8601} [myid:%X{myid}] - 
%-5p [%t:%C{1}@%L] - %m%n
--- End diff --

I'd generally advise against [enabling location 
information](http://logging.apache.org/log4j/2.x/manual/layouts.html#LocationInformation)
 by default due to performance issues. I personally don't find location 
information all that useful outside of caught exceptions anyways.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #148: ZOOKEEPER-2659 Log4j 2 migration

2017-01-15 Thread jvz
Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145357
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
@@ -413,13 +418,18 @@ public void testBadPeerAddressInQuorum() throws 
Exception {
 ClientBase.setupTestEnv();
 
 // setup the logger to capture all logs
+LoggerContext loggerContext =  (LoggerContext) 
LogManager.getContext(false);
--- End diff --

If this test is just storing log messages for verification at the end of 
the test, then I recommend using log4j-core:test's `LoggerContextRule` and 
`ListAppender`. Example: 
[LoggerTest](https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java),
 
[config.xml](https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/test/resources/log4j-test2.xml)
 (see the `` appender configs). This way, the test won't 
break if internal details of log4j-core change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823407#comment-15823407
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
---

Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145164
  
--- Diff: conf/log4j2.xml ---
@@ -0,0 +1,56 @@
+
+
+
--- End diff --

Not sure why you're using strict mode here. You're not using the right XML 
elements for strict mode. See the 
[docs](http://logging.apache.org/log4j/2.x/manual/configuration.html#Strict_XML).
 It'd be simpler to just remove the strict attribute as it's not the same type 
of strict as JS or Perl, for example (it's mainly useful for XSD validation).


> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823412#comment-15823412
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
---

Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145267
  
--- Diff: src/docs/src/documentation/content/xdocs/zookeeperInternals.xml 
---
@@ -399,11 +399,11 @@ hierarchy of groups.
 
 Zookeeper uses 
 http://www.slf4j.org/index.html;>slf4j as an 
abstraction layer for logging. 
-http://logging.apache.org/log4j;>log4j in version 1.2 
is chosen as the final logging implementation for now.
+http://logging.apache.org/log4j/2.x/;>log4j2 in 
version 2 is chosen as the final logging implementation for now.
--- End diff --

Could you make this an https link? I've been trying to encourage the use of 
the https site.


> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823411#comment-15823411
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
---

Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145281
  
--- Diff: src/docs/src/documentation/content/xdocs/zookeeperJMX.xml ---
@@ -100,15 +100,15 @@
   started the server you will be able to monitor and manage various
   service related features.
 
-Also note that ZooKeeper will register log4j MBeans as
+
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] zookeeper pull request #148: ZOOKEEPER-2659 Log4j 2 migration

2017-01-15 Thread jvz
Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145281
  
--- Diff: src/docs/src/documentation/content/xdocs/zookeeperJMX.xml ---
@@ -100,15 +100,15 @@
   started the server you will be able to monitor and manage various
   service related features.
 
-Also note that ZooKeeper will register log4j MBeans as
+

[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823406#comment-15823406
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
---

Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145218
  
--- Diff: conf/log4j2.xml ---
@@ -0,0 +1,56 @@
+
+
+
+  
+%d{ISO8601} [myid:%X{myid}] - 
%-5p [%t:%C{1}@%L] - %m%n
--- End diff --

I'd generally advise against [enabling location 
information](http://logging.apache.org/log4j/2.x/manual/layouts.html#LocationInformation)
 by default due to performance issues. I personally don't find location 
information all that useful outside of caught exceptions anyways.


> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823408#comment-15823408
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
---

Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145091
  
--- Diff: ivy.xml ---
@@ -41,13 +41,20 @@
 
   
 
-
+
+
+
+
+
+
+
+
 
   
 
 
 
-
+
--- End diff --

If anything is using log4j 1's API still, you'll need `log4j-1.2-api` as 
well.


> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] zookeeper pull request #148: ZOOKEEPER-2659 Log4j 2 migration

2017-01-15 Thread jvz
Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145251
  
--- Diff: src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml ---
@@ -618,23 +618,23 @@ server.3=zoo3:2888:3888
 
 ZooKeeper uses http://www.slf4j.org;>SLF4J
 version 1.7.5 as its logging infrastructure. For backward 
compatibility it is bound to
-LOG4J but you can use
-http://logback.qos.ch/;>LOGBack
+LOG4J2 but you can use
--- End diff --

This paragraph doesn't make much sense anymore.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #148: ZOOKEEPER-2659 Log4j 2 migration

2017-01-15 Thread jvz
Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145267
  
--- Diff: src/docs/src/documentation/content/xdocs/zookeeperInternals.xml 
---
@@ -399,11 +399,11 @@ hierarchy of groups.
 
 Zookeeper uses 
 http://www.slf4j.org/index.html;>slf4j as an 
abstraction layer for logging. 
-http://logging.apache.org/log4j;>log4j in version 1.2 
is chosen as the final logging implementation for now.
+http://logging.apache.org/log4j/2.x/;>log4j2 in 
version 2 is chosen as the final logging implementation for now.
--- End diff --

Could you make this an https link? I've been trying to encourage the use of 
the https site.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #148: ZOOKEEPER-2659 Log4j 2 migration

2017-01-15 Thread jvz
Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145076
  
--- Diff: ivy.xml ---
@@ -41,13 +41,20 @@
 
   
 
-
+
+
+
+
+
+
+
--- End diff --

Why are you using an older version of disruptor?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823410#comment-15823410
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
---

Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145357
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
@@ -413,13 +418,18 @@ public void testBadPeerAddressInQuorum() throws 
Exception {
 ClientBase.setupTestEnv();
 
 // setup the logger to capture all logs
+LoggerContext loggerContext =  (LoggerContext) 
LogManager.getContext(false);
--- End diff --

If this test is just storing log messages for verification at the end of 
the test, then I recommend using log4j-core:test's `LoggerContextRule` and 
`ListAppender`. Example: 
[LoggerTest](https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java),
 
[config.xml](https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/test/resources/log4j-test2.xml)
 (see the `` appender configs). This way, the test won't 
break if internal details of log4j-core change.


> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] zookeeper pull request #148: ZOOKEEPER-2659 Log4j 2 migration

2017-01-15 Thread jvz
Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145091
  
--- Diff: ivy.xml ---
@@ -41,13 +41,20 @@
 
   
 
-
+
+
+
+
+
+
+
+
 
   
 
 
 
-
+
--- End diff --

If anything is using log4j 1's API still, you'll need `log4j-1.2-api` as 
well.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823405#comment-15823405
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
---

Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145251
  
--- Diff: src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml ---
@@ -618,23 +618,23 @@ server.3=zoo3:2888:3888
 
 ZooKeeper uses http://www.slf4j.org;>SLF4J
 version 1.7.5 as its logging infrastructure. For backward 
compatibility it is bound to
-LOG4J but you can use
-http://logback.qos.ch/;>LOGBack
+LOG4J2 but you can use
--- End diff --

This paragraph doesn't make much sense anymore.


> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823409#comment-15823409
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
---

Github user jvz commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145076
  
--- Diff: ivy.xml ---
@@ -41,13 +41,20 @@
 
   
 
-
+
+
+
+
+
+
+
--- End diff --

Why are you using an older version of disruptor?


> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread Matt Sicker (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823404#comment-15823404
 ] 

Matt Sicker commented on ZOOKEEPER-2659:


I added several comments on the PR that didn't get cross-posted here.

> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


ZooKeeper_branch34_jdk8 - Build # 843 - Failure

2017-01-15 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper_branch34_jdk8/843/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 247750 lines...]
[junit] 2017-01-15 23:27:19,771 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11221:NIOServerCnxnFactory@219] - 
NIOServerCnxn factory exited run method
[junit] 2017-01-15 23:27:19,771 [myid:] - INFO  [main:ZooKeeperServer@497] 
- shutting down
[junit] 2017-01-15 23:27:19,771 [myid:] - ERROR [main:ZooKeeperServer@472] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-01-15 23:27:19,772 [myid:] - INFO  
[main:SessionTrackerImpl@225] - Shutting down
[junit] 2017-01-15 23:27:19,772 [myid:] - INFO  
[main:PrepRequestProcessor@765] - Shutting down
[junit] 2017-01-15 23:27:19,772 [myid:] - INFO  
[main:SyncRequestProcessor@208] - Shutting down
[junit] 2017-01-15 23:27:19,772 [myid:] - INFO  [ProcessThread(sid:0 
cport:11221)::PrepRequestProcessor@143] - PrepRequestProcessor exited loop!
[junit] 2017-01-15 23:27:19,773 [myid:] - INFO  
[SyncThread:0:SyncRequestProcessor@186] - SyncRequestProcessor exited!
[junit] 2017-01-15 23:27:19,773 [myid:] - INFO  
[main:FinalRequestProcessor@402] - shutdown of request processor complete
[junit] 2017-01-15 23:27:19,774 [myid:] - INFO  
[main:FourLetterWordMain@62] - connecting to 127.0.0.1 11221
[junit] 2017-01-15 23:27:19,774 [myid:] - INFO  [main:JMXEnv@147] - 
ensureOnly:[]
[junit] 2017-01-15 23:27:19,776 [myid:] - INFO  [main:ClientBase@445] - 
STARTING server
[junit] 2017-01-15 23:27:19,776 [myid:] - INFO  [main:ClientBase@366] - 
CREATING server instance 127.0.0.1:11221
[junit] 2017-01-15 23:27:19,776 [myid:] - INFO  
[main:NIOServerCnxnFactory@89] - binding to port 0.0.0.0/0.0.0.0:11221
[junit] 2017-01-15 23:27:19,777 [myid:] - INFO  [main:ClientBase@341] - 
STARTING server instance 127.0.0.1:11221
[junit] 2017-01-15 23:27:19,777 [myid:] - INFO  [main:ZooKeeperServer@173] 
- Created server with tickTime 3000 minSessionTimeout 6000 maxSessionTimeout 
6 datadir 
/home/jenkins/jenkins-slave/workspace/ZooKeeper_branch34_jdk8/build/test/tmp/test4740017011868630089.junit.dir/version-2
 snapdir 
/home/jenkins/jenkins-slave/workspace/ZooKeeper_branch34_jdk8/build/test/tmp/test4740017011868630089.junit.dir/version-2
[junit] 2017-01-15 23:27:19,780 [myid:] - ERROR [main:ZooKeeperServer@472] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-01-15 23:27:19,780 [myid:] - INFO  
[main:FourLetterWordMain@62] - connecting to 127.0.0.1 11221
[junit] 2017-01-15 23:27:19,781 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11221:NIOServerCnxnFactory@192] - 
Accepted socket connection from /127.0.0.1:45625
[junit] 2017-01-15 23:27:19,781 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11221:NIOServerCnxn@827] - Processing 
stat command from /127.0.0.1:45625
[junit] 2017-01-15 23:27:19,782 [myid:] - INFO  
[Thread-4:NIOServerCnxn$StatCommand@663] - Stat command output
[junit] 2017-01-15 23:27:19,782 [myid:] - INFO  
[Thread-4:NIOServerCnxn@1008] - Closed socket connection for client 
/127.0.0.1:45625 (no session established for client)
[junit] 2017-01-15 23:27:19,782 [myid:] - INFO  [main:JMXEnv@230] - 
ensureParent:[InMemoryDataTree, StandaloneServer_port]
[junit] 2017-01-15 23:27:19,784 [myid:] - INFO  [main:JMXEnv@247] - 
expect:InMemoryDataTree
[junit] 2017-01-15 23:27:19,784 [myid:] - INFO  [main:JMXEnv@251] - 
found:InMemoryDataTree 
org.apache.ZooKeeperService:name0=StandaloneServer_port11221,name1=InMemoryDataTree
[junit] 2017-01-15 23:27:19,785 [myid:] - INFO  [main:JMXEnv@247] - 
expect:StandaloneServer_port
[junit] 2017-01-15 23:27:19,785 [myid:] - INFO  [main:JMXEnv@251] - 
found:StandaloneServer_port 
org.apache.ZooKeeperService:name0=StandaloneServer_port11221
[junit] 2017-01-15 23:27:19,786 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@58] - Memory used 33649
[junit] 2017-01-15 23:27:19,786 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@63] - Number of threads 20
[junit] 2017-01-15 23:27:19,786 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@78] - FINISHED TEST METHOD testQuota
[junit] 2017-01-15 23:27:19,786 [myid:] - INFO  [main:ClientBase@522] - 
tearDown starting
[junit] 2017-01-15 23:27:19,853 [myid:] - INFO  
[main-EventThread:ClientCnxn$EventThread@519] - EventThread shut down for 
session: 0x159a474dc9d
[junit] 2017-01-15 23:27:19,854 [myid:] - INFO  [main:ZooKeeper@684] - 
Session: 0x159a474dc9d closed
[junit] 2017-01-15 23:27:19,854 [myid:] - INFO  [main:ClientBase@492] - 
STOPPING server
[junit] 2017-01-15 23:27:19,855 

ZooKeeper-trunk - Build # 3239 - Still Failing

2017-01-15 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper-trunk/3239/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 479467 lines...]
[junit] 2017-01-15 23:26:50,796 [myid:] - INFO  
[main-EventThread:ClientCnxn$EventThread@513] - EventThread shut down for 
session: 0x102383076e1
[junit] 2017-01-15 23:26:50,796 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@87] - Number of threads 1644
[junit] 2017-01-15 23:26:50,796 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@102] - FINISHED TEST METHOD 
testWatcherAutoResetWithLocal
[junit] 2017-01-15 23:26:50,797 [myid:] - INFO  [main:ClientBase@558] - 
tearDown starting
[junit] 2017-01-15 23:26:50,797 [myid:] - INFO  [main:ClientBase@528] - 
STOPPING server
[junit] 2017-01-15 23:26:50,797 [myid:] - INFO  
[main:NettyServerCnxnFactory@464] - shutdown called 0.0.0.0/0.0.0.0:11468
[junit] 2017-01-15 23:26:50,800 [myid:] - INFO  [main:ZooKeeperServer@534] 
- shutting down
[junit] 2017-01-15 23:26:50,800 [myid:] - ERROR [main:ZooKeeperServer@506] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-01-15 23:26:50,800 [myid:] - INFO  
[main:SessionTrackerImpl@232] - Shutting down
[junit] 2017-01-15 23:26:50,800 [myid:] - INFO  
[main:PrepRequestProcessor@1009] - Shutting down
[junit] 2017-01-15 23:26:50,800 [myid:] - INFO  
[main:SyncRequestProcessor@191] - Shutting down
[junit] 2017-01-15 23:26:50,800 [myid:] - INFO  [ProcessThread(sid:0 
cport:11468)::PrepRequestProcessor@157] - PrepRequestProcessor exited loop!
[junit] 2017-01-15 23:26:50,800 [myid:] - INFO  
[SyncThread:0:SyncRequestProcessor@169] - SyncRequestProcessor exited!
[junit] 2017-01-15 23:26:50,800 [myid:] - INFO  
[main:FinalRequestProcessor@481] - shutdown of request processor complete
[junit] 2017-01-15 23:26:50,801 [myid:] - INFO  [main:MBeanRegistry@128] - 
Unregister MBean 
[org.apache.ZooKeeperService:name0=StandaloneServer_port11468,name1=InMemoryDataTree]
[junit] 2017-01-15 23:26:50,801 [myid:] - INFO  [main:MBeanRegistry@128] - 
Unregister MBean [org.apache.ZooKeeperService:name0=StandaloneServer_port11468]
[junit] 2017-01-15 23:26:50,801 [myid:] - INFO  
[main:FourLetterWordMain@85] - connecting to 127.0.0.1 11468
[junit] 2017-01-15 23:26:50,801 [myid:] - INFO  [main:JMXEnv@146] - 
ensureOnly:[]
[junit] 2017-01-15 23:26:50,806 [myid:] - INFO  [main:ClientBase@583] - 
fdcount after test is: 4827 at start it was 4823
[junit] 2017-01-15 23:26:50,806 [myid:] - INFO  [main:ClientBase@585] - 
sleeping for 20 secs
[junit] 2017-01-15 23:26:50,806 [myid:] - INFO  [main:ZKTestCase$1@65] - 
SUCCEEDED testWatcherAutoResetWithLocal
[junit] 2017-01-15 23:26:50,806 [myid:] - INFO  [main:ZKTestCase$1@60] - 
FINISHED testWatcherAutoResetWithLocal
[junit] Tests run: 103, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 
463.285 sec, Thread: 1, Class: org.apache.zookeeper.test.NioNettySuiteTest
[junit] 2017-01-15 23:26:50,826 [myid:127.0.0.1:11222] - INFO  
[main-SendThread(127.0.0.1:11222):ClientCnxn$SendThread@1113] - Opening socket 
connection to server 127.0.0.1/127.0.0.1:11222. Will not attempt to 
authenticate using SASL (unknown error)
[junit] 2017-01-15 23:26:50,826 [myid:127.0.0.1:11222] - WARN  
[main-SendThread(127.0.0.1:11222):ClientCnxn$SendThread@1235] - Session 
0x10238297cc0 for server 127.0.0.1/127.0.0.1:11222, unexpected error, 
closing socket connection and attempting reconnect
[junit] java.net.ConnectException: Connection refused
[junit] at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
[junit] at 
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744)
[junit] at 
org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:357)
[junit] at 
org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1214)
[junit] 2017-01-15 23:26:50,862 [myid:127.0.0.1:11351] - INFO  
[main-SendThread(127.0.0.1:11351):ClientCnxn$SendThread@1113] - Opening socket 
connection to server 127.0.0.1/127.0.0.1:11351. Will not attempt to 
authenticate using SASL (unknown error)
[junit] 2017-01-15 23:26:50,863 [myid:127.0.0.1:11351] - WARN  
[main-SendThread(127.0.0.1:11351):ClientCnxn$SendThread@1235] - Session 
0x302382d4410 for server 127.0.0.1/127.0.0.1:11351, unexpected error, 
closing socket connection and attempting reconnect
[junit] java.net.ConnectException: Connection refused
[junit] at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
[junit] at 
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744)
[junit] at 
org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:357)
[junit] at 

[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823239#comment-15823239
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
---

Github user mikaelstaldal commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145992
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
@@ -615,14 +631,18 @@ public void testQuorumDefaults() throws Exception {
 ClientBase.setupTestEnv();
 
 // setup the logger to capture all logs
+LoggerContext loggerContext =  (LoggerContext) 
LogManager.getContext(false);
+Configuration logConfig = loggerContext.getConfiguration();
+
 Layout layout =
-Logger.getRootLogger().getAppender("CONSOLE").getLayout();
+   
logConfig.getRootLogger().getAppenders().get("STDOUT").getLayout();
+String appenderName = "quorumAppender";
 ByteArrayOutputStream os = new ByteArrayOutputStream();
-WriterAppender appender = new WriterAppender(layout, os);
-appender.setImmediateFlush(true);
-appender.setThreshold(Level.INFO);
-Logger zlogger = Logger.getLogger("org.apache.zookeeper");
-zlogger.addAppender(appender);
+WriterAppender appender = 
WriterAppender.createAppender((StringLayout)layout, null, new 
OutputStreamWriter(os), appenderName, false, true);
--- End diff --

It's probably a good idea to use the builder to create the appender (see 
above).


> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823240#comment-15823240
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
---

Github user mikaelstaldal commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96146002
  
--- Diff: src/java/test/org/apache/zookeeper/test/ReadOnlyModeTest.java ---
@@ -251,14 +257,19 @@ public void testSessionEstablishment() throws 
Exception {
 @Test(timeout = 9)
 public void testSeekForRwServer() throws Exception {
 // setup the logger to capture all logs
-Layout layout = Logger.getRootLogger().getAppender("CONSOLE")
-.getLayout();
+LoggerContext loggerContext =  (LoggerContext) 
LogManager.getContext(false);
+Configuration logConfig = loggerContext.getConfiguration();
+
+Layout layout =
+   
logConfig.getRootLogger().getAppenders().get("STDOUT").getLayout();
+String appenderName = "zkAppender";
 ByteArrayOutputStream os = new ByteArrayOutputStream();
-WriterAppender appender = new WriterAppender(layout, os);
-appender.setImmediateFlush(true);
-appender.setThreshold(Level.INFO);
-Logger zlogger = Logger.getLogger("org.apache.zookeeper");
-zlogger.addAppender(appender);
+WriterAppender appender = 
WriterAppender.createAppender((StringLayout)layout, null, new 
OutputStreamWriter(os), appenderName, false, true);
--- End diff --

It's probably a good idea to use the builder to create the appender (see 
above).


> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823238#comment-15823238
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
---

Github user mikaelstaldal commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145970
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
@@ -470,16 +481,20 @@ public void testBadPeerAddressInQuorum() throws 
Exception {
 @Test
 public void testInconsistentPeerType() throws Exception {
 ClientBase.setupTestEnv();
-
-// setup the logger to capture all logs
+
+LoggerContext loggerContext =  (LoggerContext) 
LogManager.getContext(false);
+Configuration logConfig = loggerContext.getConfiguration();
+
 Layout layout =
-Logger.getRootLogger().getAppender("CONSOLE").getLayout();
+   
logConfig.getRootLogger().getAppenders().get("STDOUT").getLayout();
+String appenderName = "quorumAppender";
 ByteArrayOutputStream os = new ByteArrayOutputStream();
-WriterAppender appender = new WriterAppender(layout, os);
-appender.setThreshold(Level.INFO);
-Logger qlogger = 
Logger.getLogger("org.apache.zookeeper.server.quorum");
-qlogger.addAppender(appender);
-
+WriterAppender appender = 
WriterAppender.createAppender((StringLayout)layout, null, new 
OutputStreamWriter(os), appenderName, false, true);
--- End diff --

It's probably a good idea to use the builder to create the appender (see 
above).


> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] zookeeper pull request #148: ZOOKEEPER-2659 Log4j 2 migration

2017-01-15 Thread mikaelstaldal
Github user mikaelstaldal commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145970
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
@@ -470,16 +481,20 @@ public void testBadPeerAddressInQuorum() throws 
Exception {
 @Test
 public void testInconsistentPeerType() throws Exception {
 ClientBase.setupTestEnv();
-
-// setup the logger to capture all logs
+
+LoggerContext loggerContext =  (LoggerContext) 
LogManager.getContext(false);
+Configuration logConfig = loggerContext.getConfiguration();
+
 Layout layout =
-Logger.getRootLogger().getAppender("CONSOLE").getLayout();
+   
logConfig.getRootLogger().getAppenders().get("STDOUT").getLayout();
+String appenderName = "quorumAppender";
 ByteArrayOutputStream os = new ByteArrayOutputStream();
-WriterAppender appender = new WriterAppender(layout, os);
-appender.setThreshold(Level.INFO);
-Logger qlogger = 
Logger.getLogger("org.apache.zookeeper.server.quorum");
-qlogger.addAppender(appender);
-
+WriterAppender appender = 
WriterAppender.createAppender((StringLayout)layout, null, new 
OutputStreamWriter(os), appenderName, false, true);
--- End diff --

It's probably a good idea to use the builder to create the appender (see 
above).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #148: ZOOKEEPER-2659 Log4j 2 migration

2017-01-15 Thread mikaelstaldal
Github user mikaelstaldal commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96146002
  
--- Diff: src/java/test/org/apache/zookeeper/test/ReadOnlyModeTest.java ---
@@ -251,14 +257,19 @@ public void testSessionEstablishment() throws 
Exception {
 @Test(timeout = 9)
 public void testSeekForRwServer() throws Exception {
 // setup the logger to capture all logs
-Layout layout = Logger.getRootLogger().getAppender("CONSOLE")
-.getLayout();
+LoggerContext loggerContext =  (LoggerContext) 
LogManager.getContext(false);
+Configuration logConfig = loggerContext.getConfiguration();
+
+Layout layout =
+   
logConfig.getRootLogger().getAppenders().get("STDOUT").getLayout();
+String appenderName = "zkAppender";
 ByteArrayOutputStream os = new ByteArrayOutputStream();
-WriterAppender appender = new WriterAppender(layout, os);
-appender.setImmediateFlush(true);
-appender.setThreshold(Level.INFO);
-Logger zlogger = Logger.getLogger("org.apache.zookeeper");
-zlogger.addAppender(appender);
+WriterAppender appender = 
WriterAppender.createAppender((StringLayout)layout, null, new 
OutputStreamWriter(os), appenderName, false, true);
--- End diff --

It's probably a good idea to use the builder to create the appender (see 
above).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #148: ZOOKEEPER-2659 Log4j 2 migration

2017-01-15 Thread mikaelstaldal
Github user mikaelstaldal commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145992
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
@@ -615,14 +631,18 @@ public void testQuorumDefaults() throws Exception {
 ClientBase.setupTestEnv();
 
 // setup the logger to capture all logs
+LoggerContext loggerContext =  (LoggerContext) 
LogManager.getContext(false);
+Configuration logConfig = loggerContext.getConfiguration();
+
 Layout layout =
-Logger.getRootLogger().getAppender("CONSOLE").getLayout();
+   
logConfig.getRootLogger().getAppenders().get("STDOUT").getLayout();
+String appenderName = "quorumAppender";
 ByteArrayOutputStream os = new ByteArrayOutputStream();
-WriterAppender appender = new WriterAppender(layout, os);
-appender.setImmediateFlush(true);
-appender.setThreshold(Level.INFO);
-Logger zlogger = Logger.getLogger("org.apache.zookeeper");
-zlogger.addAppender(appender);
+WriterAppender appender = 
WriterAppender.createAppender((StringLayout)layout, null, new 
OutputStreamWriter(os), appenderName, false, true);
--- End diff --

It's probably a good idea to use the builder to create the appender (see 
above).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823237#comment-15823237
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
---

Github user mikaelstaldal commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145959
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
@@ -413,13 +418,18 @@ public void testBadPeerAddressInQuorum() throws 
Exception {
 ClientBase.setupTestEnv();
 
 // setup the logger to capture all logs
+LoggerContext loggerContext =  (LoggerContext) 
LogManager.getContext(false);
+Configuration logConfig = loggerContext.getConfiguration();
+
 Layout layout =
-Logger.getRootLogger().getAppender("CONSOLE").getLayout();
+   
logConfig.getRootLogger().getAppenders().get("STDOUT").getLayout();
+String appenderName = "quorumAppender";
 ByteArrayOutputStream os = new ByteArrayOutputStream();
-WriterAppender appender = new WriterAppender(layout, os);
-appender.setThreshold(Level.WARN);
-Logger qlogger = 
Logger.getLogger("org.apache.zookeeper.server.quorum");
-qlogger.addAppender(appender);
+WriterAppender appender = 
WriterAppender.createAppender((StringLayout)layout, null, new 
OutputStreamWriter(os), appenderName, false, true);
--- End diff --

It's probably a good idea to use the builder to create the appender:

```
WriterAppender.newBuilder().setLayout((StringLayout)layout).setTarget(new 
OutputStreamWriter(os)).setName(appenderName).build();
```



> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] zookeeper pull request #148: ZOOKEEPER-2659 Log4j 2 migration

2017-01-15 Thread mikaelstaldal
Github user mikaelstaldal commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/148#discussion_r96145959
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
@@ -413,13 +418,18 @@ public void testBadPeerAddressInQuorum() throws 
Exception {
 ClientBase.setupTestEnv();
 
 // setup the logger to capture all logs
+LoggerContext loggerContext =  (LoggerContext) 
LogManager.getContext(false);
+Configuration logConfig = loggerContext.getConfiguration();
+
 Layout layout =
-Logger.getRootLogger().getAppender("CONSOLE").getLayout();
+   
logConfig.getRootLogger().getAppenders().get("STDOUT").getLayout();
+String appenderName = "quorumAppender";
 ByteArrayOutputStream os = new ByteArrayOutputStream();
-WriterAppender appender = new WriterAppender(layout, os);
-appender.setThreshold(Level.WARN);
-Logger qlogger = 
Logger.getLogger("org.apache.zookeeper.server.quorum");
-qlogger.addAppender(appender);
+WriterAppender appender = 
WriterAppender.createAppender((StringLayout)layout, null, new 
OutputStreamWriter(os), appenderName, false, true);
--- End diff --

It's probably a good idea to use the builder to create the appender:

```
WriterAppender.newBuilder().setLayout((StringLayout)layout).setTarget(new 
OutputStreamWriter(os)).setName(appenderName).build();
```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated

2017-01-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823226#comment-15823226
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
---

Github user mikaelstaldal commented on the issue:

https://github.com/apache/zookeeper/pull/148
  
I would say that it is not proper to refer to Log4j 2.x as "Log4J2". You 
should refer to it as "Log4j 2.x" or "Log4j 2".


> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> 
>
> Key: ZOOKEEPER-2659
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
> Project: ZooKeeper
>  Issue Type: Wish
>Reporter: Pushkar Raste
>Priority: Minor
> Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. 
> {{log4j 1.X}} is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] zookeeper issue #148: ZOOKEEPER-2659 Log4j2 migration

2017-01-15 Thread mikaelstaldal
Github user mikaelstaldal commented on the issue:

https://github.com/apache/zookeeper/pull/148
  
I would say that it is not proper to refer to Log4j 2.x as "Log4J2". You 
should refer to it as "Log4j 2.x" or "Log4j 2".


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


ZooKeeper_branch35_solaris - Build # 397 - Still Failing

2017-01-15 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper_branch35_solaris/397/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 469949 lines...]
[junit] 2017-01-15 17:16:10,345 [myid:] - INFO  [main:ClientBase@386] - 
CREATING server instance 127.0.0.1:11222
[junit] 2017-01-15 17:16:10,345 [myid:] - INFO  
[main:NIOServerCnxnFactory@673] - Configuring NIO connection handler with 10s 
sessionless connection timeout, 2 selector thread(s), 16 worker threads, and 64 
kB direct buffers.
[junit] 2017-01-15 17:16:10,346 [myid:] - INFO  
[main:NIOServerCnxnFactory@686] - binding to port 0.0.0.0/0.0.0.0:11222
[junit] 2017-01-15 17:16:10,346 [myid:] - INFO  [main:ClientBase@361] - 
STARTING server instance 127.0.0.1:11222
[junit] 2017-01-15 17:16:10,347 [myid:] - INFO  [main:ZooKeeperServer@893] 
- minSessionTimeout set to 6000
[junit] 2017-01-15 17:16:10,347 [myid:] - INFO  [main:ZooKeeperServer@902] 
- maxSessionTimeout set to 6
[junit] 2017-01-15 17:16:10,347 [myid:] - INFO  [main:ZooKeeperServer@159] 
- Created server with tickTime 3000 minSessionTimeout 6000 maxSessionTimeout 
6 datadir 
/zonestorage/hudson_solaris/home/hudson/hudson-slave/workspace/ZooKeeper_branch35_solaris/build/test/tmp/test560250876150784438.junit.dir/version-2
 snapdir 
/zonestorage/hudson_solaris/home/hudson/hudson-slave/workspace/ZooKeeper_branch35_solaris/build/test/tmp/test560250876150784438.junit.dir/version-2
[junit] 2017-01-15 17:16:10,348 [myid:] - INFO  [main:FileSnap@83] - 
Reading snapshot 
/zonestorage/hudson_solaris/home/hudson/hudson-slave/workspace/ZooKeeper_branch35_solaris/build/test/tmp/test560250876150784438.junit.dir/version-2/snapshot.b
[junit] 2017-01-15 17:16:10,350 [myid:] - INFO  [main:FileTxnSnapLog@320] - 
Snapshotting: 0xb to 
/zonestorage/hudson_solaris/home/hudson/hudson-slave/workspace/ZooKeeper_branch35_solaris/build/test/tmp/test560250876150784438.junit.dir/version-2/snapshot.b
[junit] 2017-01-15 17:16:10,351 [myid:] - ERROR [main:ZooKeeperServer@505] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-01-15 17:16:10,351 [myid:] - INFO  
[main:FourLetterWordMain@85] - connecting to 127.0.0.1 11222
[junit] 2017-01-15 17:16:10,352 [myid:] - INFO  
[NIOServerCxnFactory.AcceptThread:0.0.0.0/0.0.0.0:11222:NIOServerCnxnFactory$AcceptThread@296]
 - Accepted socket connection from /127.0.0.1:65243
[junit] 2017-01-15 17:16:10,352 [myid:] - INFO  
[NIOWorkerThread-1:NIOServerCnxn@485] - Processing stat command from 
/127.0.0.1:65243
[junit] 2017-01-15 17:16:10,353 [myid:] - INFO  
[NIOWorkerThread-1:StatCommand@49] - Stat command output
[junit] 2017-01-15 17:16:10,353 [myid:] - INFO  
[NIOWorkerThread-1:NIOServerCnxn@614] - Closed socket connection for client 
/127.0.0.1:65243 (no session established for client)
[junit] 2017-01-15 17:16:10,353 [myid:] - INFO  [main:JMXEnv@228] - 
ensureParent:[InMemoryDataTree, StandaloneServer_port]
[junit] 2017-01-15 17:16:10,354 [myid:] - INFO  [main:JMXEnv@245] - 
expect:InMemoryDataTree
[junit] 2017-01-15 17:16:10,354 [myid:] - INFO  [main:JMXEnv@249] - 
found:InMemoryDataTree 
org.apache.ZooKeeperService:name0=StandaloneServer_port11222,name1=InMemoryDataTree
[junit] 2017-01-15 17:16:10,355 [myid:] - INFO  [main:JMXEnv@245] - 
expect:StandaloneServer_port
[junit] 2017-01-15 17:16:10,355 [myid:] - INFO  [main:JMXEnv@249] - 
found:StandaloneServer_port 
org.apache.ZooKeeperService:name0=StandaloneServer_port11222
[junit] 2017-01-15 17:16:10,355 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@82] - Memory used 17891
[junit] 2017-01-15 17:16:10,355 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@87] - Number of threads 24
[junit] 2017-01-15 17:16:10,355 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@102] - FINISHED TEST METHOD 
testQuota
[junit] 2017-01-15 17:16:10,355 [myid:] - INFO  [main:ClientBase@543] - 
tearDown starting
[junit] 2017-01-15 17:16:10,432 [myid:] - INFO  [main:ZooKeeper@1322] - 
Session: 0x126201a7468 closed
[junit] 2017-01-15 17:16:10,432 [myid:] - INFO  
[main-EventThread:ClientCnxn$EventThread@513] - EventThread shut down for 
session: 0x126201a7468
[junit] 2017-01-15 17:16:10,432 [myid:] - INFO  [main:ClientBase@513] - 
STOPPING server
[junit] 2017-01-15 17:16:10,432 [myid:] - INFO  
[NIOServerCxnFactory.AcceptThread:0.0.0.0/0.0.0.0:11222:NIOServerCnxnFactory$AcceptThread@219]
 - accept thread exitted run method
[junit] 2017-01-15 17:16:10,432 [myid:] - INFO  
[NIOServerCxnFactory.SelectorThread-0:NIOServerCnxnFactory$SelectorThread@420] 
- selector thread exitted run method
[junit] 2017-01-15 17:16:10,432 [myid:] - INFO  

ZooKeeper_branch34_openjdk7 - Build # 1349 - Failure

2017-01-15 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper_branch34_openjdk7/1349/

###
## LAST 60 LINES OF THE CONSOLE 
###
Started by timer
[EnvInject] - Loading node environment variables.
Building remotely on H12 (ubuntu) in workspace 
/home/jenkins/jenkins-slave/workspace/ZooKeeper_branch34_openjdk7
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url git://git.apache.org/zookeeper.git # timeout=10
Cleaning workspace
 > git rev-parse --verify HEAD # timeout=10
Resetting working tree
 > git reset --hard # timeout=10
 > git clean -fdx # timeout=10
Fetching upstream changes from git://git.apache.org/zookeeper.git
 > git --version # timeout=10
 > git -c core.askpass=true fetch --tags --progress 
 > git://git.apache.org/zookeeper.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/branch-3.4^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/branch-3.4^{commit} # timeout=10
Checking out Revision cded802708fac417369affbd25bf9ad2016a904d 
(refs/remotes/origin/branch-3.4)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f cded802708fac417369affbd25bf9ad2016a904d
 > git rev-list cded802708fac417369affbd25bf9ad2016a904d # timeout=10
No emails were triggered.
[ZooKeeper_branch34_openjdk7] $ /home/jenkins/tools/ant/latest/bin/ant 
-Dtest.output=yes -Dtest.junit.threads=8 -Dtest.junit.output.format=xml 
-Djavac.target=1.7 clean test-core-java
Error: JAVA_HOME is not defined correctly.
  We cannot execute /usr/lib/jvm/java-7-openjdk-amd64//bin/java
Build step 'Invoke Ant' marked build as failure
Recording test results
ERROR: Step ?Publish JUnit test result report? failed: No test report files 
were found. Configuration error?
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any



###
## FAILED TESTS (if any) 
##
No tests ran.

ZooKeeper_branch34_solaris - Build # 1432 - Still Failing

2017-01-15 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper_branch34_solaris/1432/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 192001 lines...]
[junit] 2017-01-15 13:53:32,875 [myid:] - INFO  
[main:PrepRequestProcessor@765] - Shutting down
[junit] 2017-01-15 13:53:32,876 [myid:] - INFO  
[main:SyncRequestProcessor@208] - Shutting down
[junit] 2017-01-15 13:53:32,876 [myid:] - INFO  [ProcessThread(sid:0 
cport:11221)::PrepRequestProcessor@143] - PrepRequestProcessor exited loop!
[junit] 2017-01-15 13:53:32,876 [myid:] - INFO  
[SyncThread:0:SyncRequestProcessor@186] - SyncRequestProcessor exited!
[junit] 2017-01-15 13:53:32,876 [myid:] - INFO  
[main:FinalRequestProcessor@402] - shutdown of request processor complete
[junit] 2017-01-15 13:53:32,876 [myid:] - INFO  
[main:FourLetterWordMain@62] - connecting to 127.0.0.1 11221
[junit] 2017-01-15 13:53:32,877 [myid:] - INFO  [main:JMXEnv@147] - 
ensureOnly:[]
[junit] 2017-01-15 13:53:32,878 [myid:] - INFO  [main:ClientBase@445] - 
STARTING server
[junit] 2017-01-15 13:53:32,878 [myid:] - INFO  [main:ClientBase@366] - 
CREATING server instance 127.0.0.1:11221
[junit] 2017-01-15 13:53:32,878 [myid:] - INFO  
[main:NIOServerCnxnFactory@89] - binding to port 0.0.0.0/0.0.0.0:11221
[junit] 2017-01-15 13:53:32,879 [myid:] - INFO  [main:ClientBase@341] - 
STARTING server instance 127.0.0.1:11221
[junit] 2017-01-15 13:53:32,879 [myid:] - INFO  [main:ZooKeeperServer@173] 
- Created server with tickTime 3000 minSessionTimeout 6000 maxSessionTimeout 
6 datadir 
/zonestorage/hudson_solaris/home/hudson/hudson-slave/workspace/ZooKeeper_branch34_solaris/build/test/tmp/test5413774801120187797.junit.dir/version-2
 snapdir 
/zonestorage/hudson_solaris/home/hudson/hudson-slave/workspace/ZooKeeper_branch34_solaris/build/test/tmp/test5413774801120187797.junit.dir/version-2
[junit] 2017-01-15 13:53:32,881 [myid:] - ERROR [main:ZooKeeperServer@472] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-01-15 13:53:32,882 [myid:] - INFO  
[main:FourLetterWordMain@62] - connecting to 127.0.0.1 11221
[junit] 2017-01-15 13:53:32,882 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11221:NIOServerCnxnFactory@192] - 
Accepted socket connection from /127.0.0.1:45965
[junit] 2017-01-15 13:53:32,882 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11221:NIOServerCnxn@827] - Processing 
stat command from /127.0.0.1:45965
[junit] 2017-01-15 13:53:32,882 [myid:] - INFO  
[Thread-5:NIOServerCnxn$StatCommand@663] - Stat command output
[junit] 2017-01-15 13:53:32,883 [myid:] - INFO  
[Thread-5:NIOServerCnxn@1008] - Closed socket connection for client 
/127.0.0.1:45965 (no session established for client)
[junit] 2017-01-15 13:53:32,883 [myid:] - INFO  [main:JMXEnv@230] - 
ensureParent:[InMemoryDataTree, StandaloneServer_port]
[junit] 2017-01-15 13:53:32,884 [myid:] - INFO  [main:JMXEnv@247] - 
expect:InMemoryDataTree
[junit] 2017-01-15 13:53:32,884 [myid:] - INFO  [main:JMXEnv@251] - 
found:InMemoryDataTree 
org.apache.ZooKeeperService:name0=StandaloneServer_port11221,name1=InMemoryDataTree
[junit] 2017-01-15 13:53:32,884 [myid:] - INFO  [main:JMXEnv@247] - 
expect:StandaloneServer_port
[junit] 2017-01-15 13:53:32,884 [myid:] - INFO  [main:JMXEnv@251] - 
found:StandaloneServer_port 
org.apache.ZooKeeperService:name0=StandaloneServer_port11221
[junit] 2017-01-15 13:53:32,885 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@58] - Memory used 9120
[junit] 2017-01-15 13:53:32,885 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@63] - Number of threads 20
[junit] 2017-01-15 13:53:32,885 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@78] - FINISHED TEST METHOD testQuota
[junit] 2017-01-15 13:53:32,885 [myid:] - INFO  [main:ClientBase@522] - 
tearDown starting
[junit] 2017-01-15 13:53:32,972 [myid:] - INFO  [main:ZooKeeper@684] - 
Session: 0x159a2678db3 closed
[junit] 2017-01-15 13:53:32,972 [myid:] - INFO  
[main-EventThread:ClientCnxn$EventThread@519] - EventThread shut down for 
session: 0x159a2678db3
[junit] 2017-01-15 13:53:32,972 [myid:] - INFO  [main:ClientBase@492] - 
STOPPING server
[junit] 2017-01-15 13:53:32,973 [myid:] - INFO  [main:ZooKeeperServer@497] 
- shutting down
[junit] 2017-01-15 13:53:32,973 [myid:] - ERROR [main:ZooKeeperServer@472] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-01-15 13:53:32,973 [myid:] - INFO  
[main:SessionTrackerImpl@225] - Shutting down
[junit] 2017-01-15 13:53:32,973 [myid:] - INFO  
[main:PrepRequestProcessor@765] - Shutting down
[junit] 2017-01-15 13:53:32,974 

ZooKeeper_branch35_jdk8 - Build # 379 - Still Failing

2017-01-15 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper_branch35_jdk8/379/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 481490 lines...]
[junit] java.net.ConnectException: Connection refused
[junit] at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
[junit] at 
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
[junit] at 
org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:357)
[junit] at 
org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1214)
[junit] 2017-01-15 12:08:27,248 [myid:] - INFO  [ProcessThread(sid:0 
cport:14161)::PrepRequestProcessor@656] - Processed session termination for 
sessionid: 0x102e7d8eccd
[junit] 2017-01-15 12:08:27,251 [myid:] - INFO  
[SyncThread:0:MBeanRegistry@128] - Unregister MBean 
[org.apache.ZooKeeperService:name0=StandaloneServer_port14161,name1=Connections,name2=127.0.0.1,name3=0x102e7d8eccd]
[junit] 2017-01-15 12:08:27,251 [myid:] - WARN  [New I/O worker 
#1829:NettyServerCnxnFactory$CnxnChannelHandler@142] - Exception caught [id: 
0x08484c0a, /127.0.0.1:32944 :> /127.0.0.1:14161] EXCEPTION: 
java.nio.channels.ClosedChannelException
[junit] java.nio.channels.ClosedChannelException
[junit] at 
org.jboss.netty.channel.socket.nio.AbstractNioWorker.cleanUpWriteBuffer(AbstractNioWorker.java:433)
[junit] at 
org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:373)
[junit] at 
org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:81)
[junit] at 
org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:36)
[junit] at 
org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:779)
[junit] at 
org.jboss.netty.channel.SimpleChannelHandler.closeRequested(SimpleChannelHandler.java:334)
[junit] at 
org.jboss.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:260)
[junit] at 
org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
[junit] at 
org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:582)
[junit] at org.jboss.netty.channel.Channels.close(Channels.java:812)
[junit] at 
org.jboss.netty.channel.AbstractChannel.close(AbstractChannel.java:206)
[junit] at 
org.apache.zookeeper.server.NettyServerCnxn.close(NettyServerCnxn.java:111)
[junit] at 
org.apache.zookeeper.server.NettyServerCnxn.sendBuffer(NettyServerCnxn.java:215)
[junit] at 
org.apache.zookeeper.server.NettyServerCnxn.sendCloseSession(NettyServerCnxn.java:441)
[junit] at 
org.apache.zookeeper.server.FinalRequestProcessor.processRequest(FinalRequestProcessor.java:459)
[junit] at 
org.apache.zookeeper.server.SyncRequestProcessor.flush(SyncRequestProcessor.java:182)
[junit] at 
org.apache.zookeeper.server.SyncRequestProcessor.run(SyncRequestProcessor.java:113)
[junit] 2017-01-15 12:08:27,350 [myid:] - INFO  [main:ZooKeeper@1322] - 
Session: 0x102e7d8eccd closed
[junit] 2017-01-15 12:08:27,350 [myid:] - INFO  
[main-EventThread:ClientCnxn$EventThread@513] - EventThread shut down for 
session: 0x102e7d8eccd
[junit] 2017-01-15 12:08:27,351 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@82] - Memory used 93230
[junit] 2017-01-15 12:08:27,351 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@87] - Number of threads 466
[junit] 2017-01-15 12:08:27,351 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@102] - FINISHED TEST METHOD 
testWatcherAutoResetWithLocal
[junit] 2017-01-15 12:08:27,351 [myid:] - INFO  [main:ClientBase@543] - 
tearDown starting
[junit] 2017-01-15 12:08:27,351 [myid:] - INFO  [main:ClientBase@513] - 
STOPPING server
[junit] 2017-01-15 12:08:27,351 [myid:] - INFO  
[main:NettyServerCnxnFactory@464] - shutdown called 0.0.0.0/0.0.0.0:14161
[junit] 2017-01-15 12:08:27,352 [myid:] - INFO  [main:ZooKeeperServer@533] 
- shutting down
[junit] 2017-01-15 12:08:27,353 [myid:] - ERROR [main:ZooKeeperServer@505] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-01-15 12:08:27,353 [myid:] - INFO  
[main:SessionTrackerImpl@232] - Shutting down
[junit] 2017-01-15 12:08:27,353 [myid:] - INFO  
[main:PrepRequestProcessor@974] - Shutting down
[junit] 2017-01-15 12:08:27,353 [myid:] - INFO  
[main:SyncRequestProcessor@191] - Shutting down
[junit] 2017-01-15 12:08:27,353 [myid:] - INFO  [ProcessThread(sid:0 
cport:14161)::PrepRequestProcessor@154] - 

[jira] [Commented] (ZOOKEEPER-2184) Zookeeper Client should re-resolve hosts when connection attempts fail

2017-01-15 Thread Flavio Junqueira (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15823099#comment-15823099
 ] 

Flavio Junqueira commented on ZOOKEEPER-2184:
-

I took a stab at a pull request for the 3.4 branch and I'd appreciate some 
feedback. It is easy to miss some important detail with this hostname/address 
manipulation, so if anyone has a chance to double check what I've done, I'd 
appreciate.

For the 3.4 branch, we promise compatibility with Java 6, so the patch does not 
immediately apply because it uses {{getHostString}}, which is available only 
from Java 7. Consequently, I have added some code to get around that.

For the 3.5 branch, we will need a different patch because of the 
reconfiguration changes to {{StaticHostProvider}}. I'll work on it once the 3.4 
patch gets a +1.

> Zookeeper Client should re-resolve hosts when connection attempts fail
> --
>
> Key: ZOOKEEPER-2184
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2184
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: java client
>Affects Versions: 3.4.6, 3.5.0
> Environment: Ubuntu 14.04 host, Docker containers for Zookeeper & 
> Kafka
>Reporter: Robert P. Thille
>Assignee: Robert P. Thille
>  Labels: easyfix, patch
> Fix For: 3.4.10, 3.5.3
>
> Attachments: ZOOKEEPER-2184.patch
>
>
> Testing in a Docker environment with a single Kafka instance using a single 
> Zookeeper instance. Restarting the Zookeeper container will cause it to 
> receive a new IP address. Kafka will never be able to reconnect to Zookeeper 
> and will hang indefinitely. Updating DNS or /etc/hosts with the new IP 
> address will not help the client to reconnect as the 
> zookeeper/client/StaticHostProvider resolves the connection string hosts at 
> creation time and never re-resolves.
> A solution would be for the client to notice that connection attempts fail 
> and attempt to re-resolve the hostnames in the connectString.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


ZooKeeper-trunk-solaris - Build # 1467 - Still Failing

2017-01-15 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper-trunk-solaris/1467/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 467263 lines...]
[junit] 2017-01-15 08:22:15,142 [myid:] - INFO  [main:ClientBase@401] - 
CREATING server instance 127.0.0.1:11222
[junit] 2017-01-15 08:22:15,142 [myid:] - INFO  
[main:NIOServerCnxnFactory@673] - Configuring NIO connection handler with 10s 
sessionless connection timeout, 2 selector thread(s), 16 worker threads, and 64 
kB direct buffers.
[junit] 2017-01-15 08:22:15,143 [myid:] - INFO  
[main:NIOServerCnxnFactory@686] - binding to port 0.0.0.0/0.0.0.0:11222
[junit] 2017-01-15 08:22:15,143 [myid:] - INFO  [main:ClientBase@376] - 
STARTING server instance 127.0.0.1:11222
[junit] 2017-01-15 08:22:15,144 [myid:] - INFO  [main:ZooKeeperServer@894] 
- minSessionTimeout set to 6000
[junit] 2017-01-15 08:22:15,144 [myid:] - INFO  [main:ZooKeeperServer@903] 
- maxSessionTimeout set to 6
[junit] 2017-01-15 08:22:15,144 [myid:] - INFO  [main:ZooKeeperServer@160] 
- Created server with tickTime 3000 minSessionTimeout 6000 maxSessionTimeout 
6 datadir 
/zonestorage/hudson_solaris/home/hudson/hudson-slave/workspace/ZooKeeper-trunk-solaris/build/test/tmp/test4245347918410284500.junit.dir/version-2
 snapdir 
/zonestorage/hudson_solaris/home/hudson/hudson-slave/workspace/ZooKeeper-trunk-solaris/build/test/tmp/test4245347918410284500.junit.dir/version-2
[junit] 2017-01-15 08:22:15,145 [myid:] - INFO  [main:FileSnap@83] - 
Reading snapshot 
/zonestorage/hudson_solaris/home/hudson/hudson-slave/workspace/ZooKeeper-trunk-solaris/build/test/tmp/test4245347918410284500.junit.dir/version-2/snapshot.b
[junit] 2017-01-15 08:22:15,147 [myid:] - INFO  [main:FileTxnSnapLog@346] - 
Snapshotting: 0xb to 
/zonestorage/hudson_solaris/home/hudson/hudson-slave/workspace/ZooKeeper-trunk-solaris/build/test/tmp/test4245347918410284500.junit.dir/version-2/snapshot.b
[junit] 2017-01-15 08:22:15,148 [myid:] - ERROR [main:ZooKeeperServer@506] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-01-15 08:22:15,148 [myid:] - INFO  
[main:FourLetterWordMain@85] - connecting to 127.0.0.1 11222
[junit] 2017-01-15 08:22:15,149 [myid:] - INFO  
[NIOServerCxnFactory.AcceptThread:0.0.0.0/0.0.0.0:11222:NIOServerCnxnFactory$AcceptThread@296]
 - Accepted socket connection from /127.0.0.1:37742
[junit] 2017-01-15 08:22:15,149 [myid:] - INFO  
[NIOWorkerThread-1:NIOServerCnxn@485] - Processing stat command from 
/127.0.0.1:37742
[junit] 2017-01-15 08:22:15,149 [myid:] - INFO  
[NIOWorkerThread-1:StatCommand@49] - Stat command output
[junit] 2017-01-15 08:22:15,150 [myid:] - INFO  
[NIOWorkerThread-1:NIOServerCnxn@614] - Closed socket connection for client 
/127.0.0.1:37742 (no session established for client)
[junit] 2017-01-15 08:22:15,150 [myid:] - INFO  [main:JMXEnv@228] - 
ensureParent:[InMemoryDataTree, StandaloneServer_port]
[junit] 2017-01-15 08:22:15,151 [myid:] - INFO  [main:JMXEnv@245] - 
expect:InMemoryDataTree
[junit] 2017-01-15 08:22:15,151 [myid:] - INFO  [main:JMXEnv@249] - 
found:InMemoryDataTree 
org.apache.ZooKeeperService:name0=StandaloneServer_port11222,name1=InMemoryDataTree
[junit] 2017-01-15 08:22:15,151 [myid:] - INFO  [main:JMXEnv@245] - 
expect:StandaloneServer_port
[junit] 2017-01-15 08:22:15,152 [myid:] - INFO  [main:JMXEnv@249] - 
found:StandaloneServer_port 
org.apache.ZooKeeperService:name0=StandaloneServer_port11222
[junit] 2017-01-15 08:22:15,152 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@82] - Memory used 17904
[junit] 2017-01-15 08:22:15,152 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@87] - Number of threads 24
[junit] 2017-01-15 08:22:15,152 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@102] - FINISHED TEST METHOD 
testQuota
[junit] 2017-01-15 08:22:15,152 [myid:] - INFO  [main:ClientBase@558] - 
tearDown starting
[junit] 2017-01-15 08:22:15,232 [myid:] - INFO  [main:ZooKeeper@1324] - 
Session: 0x1261e31a9dd closed
[junit] 2017-01-15 08:22:15,232 [myid:] - INFO  [main:ClientBase@528] - 
STOPPING server
[junit] 2017-01-15 08:22:15,232 [myid:] - INFO  
[main-EventThread:ClientCnxn$EventThread@513] - EventThread shut down for 
session: 0x1261e31a9dd
[junit] 2017-01-15 08:22:15,233 [myid:] - INFO  
[ConnnectionExpirer:NIOServerCnxnFactory$ConnectionExpirerThread@583] - 
ConnnectionExpirerThread interrupted
[junit] 2017-01-15 08:22:15,233 [myid:] - INFO  
[NIOServerCxnFactory.SelectorThread-1:NIOServerCnxnFactory$SelectorThread@420] 
- selector thread exitted run method
[junit] 2017-01-15 08:22:15,233 [myid:] - INFO  
[NIOServerCxnFactory.SelectorThread-0:NIOServerCnxnFactory$SelectorThread@420] 
-