FYI - zetcd: running ZooKeeper apps without ZooKeeper

2017-05-19 Thread Jordan Zimmerman
"The zetcd proxy sits in front of an etcd cluster and serves an emulated 
ZooKeeper client port, letting unmodified ZooKeeper applications run on top of 
etcd."

https://coreos.com/blog/introducing-zetcd

[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread Hadoop QA (JIRA)

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

Hadoop QA commented on ZOOKEEPER-2784:
--

-1 overall.  GitHub Pull Request  Build
  

+1 @author.  The patch does not contain any @author tags.

+1 tests included.  The patch appears to include 6 new or modified tests.

+1 javadoc.  The javadoc tool did not generate any warning messages.

+1 javac.  The applied patch does not increase the total number of javac 
compiler warnings.

+1 findbugs.  The patch does not introduce any new Findbugs (version 3.0.1) 
warnings.

+1 release audit.  The applied patch does not increase the total number of 
release audit warnings.

-1 core tests.  The patch failed core unit tests.

+1 contrib tests.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/725//testReport/
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/725//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/725//console

This message is automatically generated.

> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


Failed: ZOOKEEPER- PreCommit Build #725

2017-05-19 Thread Apache Jenkins Server
Build: https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/725/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 68.12 MB...]
 [exec] 
 [exec] +1 javadoc.  The javadoc tool did not generate any warning 
messages.
 [exec] 
 [exec] +1 javac.  The applied patch does not increase the total number 
of javac compiler warnings.
 [exec] 
 [exec] +1 findbugs.  The patch does not introduce any new Findbugs 
(version 3.0.1) warnings.
 [exec] 
 [exec] +1 release audit.  The applied patch does not increase the 
total number of release audit warnings.
 [exec] 
 [exec] -1 core tests.  The patch failed core unit tests.
 [exec] 
 [exec] +1 contrib tests.  The patch passed contrib unit tests.
 [exec] 
 [exec] Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/725//testReport/
 [exec] Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/725//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
 [exec] Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/725//console
 [exec] 
 [exec] This message is automatically generated.
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Adding comment to Jira.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] Comment added.
 [exec] f6af07aa87983e4a19b0f9ec092360e2a9ff78db logged out
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Finished build.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] mv: 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 and 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 are the same file

BUILD FAILED
/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/build.xml:1642:
 exec returned: 1

Total time: 13 minutes 45 seconds
Build step 'Execute shell' marked build as failure
Archiving artifacts
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Compressed 576.64 KB of artifacts by 44.4% relative to #718
Recording test results
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
[description-setter] Description set: ZOOKEEPER-2784
Putting comment on the pull request
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7



###
## FAILED TESTS (if any) 
##
1 tests failed.
FAILED:  org.apache.zookeeper.test.CnxManagerTest.testSameSID

Error Message:
Connection refused

Stack Trace:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at 
org.apache.zookeeper.test.CnxManagerTest.testSameSID(CnxManagerTest.java:394)
at 
org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:79)

[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread Hadoop QA (JIRA)

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

Hadoop QA commented on ZOOKEEPER-2784:
--

-1 overall.  GitHub Pull Request  Build
  

+1 @author.  The patch does not contain any @author tags.

+1 tests included.  The patch appears to include 6 new or modified tests.

+1 javadoc.  The javadoc tool did not generate any warning messages.

+1 javac.  The applied patch does not increase the total number of javac 
compiler warnings.

+1 findbugs.  The patch does not introduce any new Findbugs (version 3.0.1) 
warnings.

+1 release audit.  The applied patch does not increase the total number of 
release audit warnings.

-1 core tests.  The patch failed core unit tests.

+1 contrib tests.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/724//testReport/
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/724//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/724//console

This message is automatically generated.

> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread Hadoop QA (JIRA)

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

Hadoop QA commented on ZOOKEEPER-2784:
--

-1 overall.  GitHub Pull Request  Build
  

+1 @author.  The patch does not contain any @author tags.

+1 tests included.  The patch appears to include 6 new or modified tests.

+1 javadoc.  The javadoc tool did not generate any warning messages.

+1 javac.  The applied patch does not increase the total number of javac 
compiler warnings.

+1 findbugs.  The patch does not introduce any new Findbugs (version 3.0.1) 
warnings.

+1 release audit.  The applied patch does not increase the total number of 
release audit warnings.

-1 core tests.  The patch failed core unit tests.

+1 contrib tests.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/723//testReport/
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/723//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/723//console

This message is automatically generated.

> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


Failed: ZOOKEEPER- PreCommit Build #723

2017-05-19 Thread Apache Jenkins Server
Build: https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/723/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 68.01 MB...]
 [exec] 
 [exec] +1 javadoc.  The javadoc tool did not generate any warning 
messages.
 [exec] 
 [exec] +1 javac.  The applied patch does not increase the total number 
of javac compiler warnings.
 [exec] 
 [exec] +1 findbugs.  The patch does not introduce any new Findbugs 
(version 3.0.1) warnings.
 [exec] 
 [exec] +1 release audit.  The applied patch does not increase the 
total number of release audit warnings.
 [exec] 
 [exec] -1 core tests.  The patch failed core unit tests.
 [exec] 
 [exec] +1 contrib tests.  The patch passed contrib unit tests.
 [exec] 
 [exec] Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/723//testReport/
 [exec] Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/723//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
 [exec] Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/723//console
 [exec] 
 [exec] This message is automatically generated.
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Adding comment to Jira.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] Comment added.
 [exec] 166776c0dadcaccd2e8a10eea50d111d89638d9a logged out
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Finished build.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] mv: 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 and 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 are the same file

BUILD FAILED
/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/build.xml:1642:
 exec returned: 1

Total time: 13 minutes 30 seconds
Build step 'Execute shell' marked build as failure
Archiving artifacts
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Compressed 576.65 KB of artifacts by 44.4% relative to #718
Recording test results
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
[description-setter] Description set: ZOOKEEPER-2784
Putting comment on the pull request
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7



###
## FAILED TESTS (if any) 
##
1 tests failed.
FAILED:  
org.apache.zookeeper.server.quorum.ReconfigDuringLeaderSyncTest.testDuringLeaderSync

Error Message:
zoo.cfg.dynamic.next is not deleted.

Stack Trace:
junit.framework.AssertionFailedError: zoo.cfg.dynamic.next is not deleted.
at 
org.apache.zookeeper.server.quorum.ReconfigDuringLeaderSyncTest.testDuringLeaderSync(ReconfigDuringLeaderSyncTest.java:165)
at 
org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:79)

[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

Github user asdf2014 commented on the issue:

https://github.com/apache/zookeeper/pull/257
  
I don't understand why `jenkins` reports `UnknownHostException`.

```java
java.net.UnknownHostException: 10.1.1.-113
at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at 
org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:448)
at 
org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:491)
at 
org.apache.zookeeper.server.quorum.QuorumCnxManager.toSend(QuorumCnxManager.java:426)
at 
org.apache.zookeeper.test.CnxManagerTest.testCnxManagerTimeout(CnxManagerTest.java:212)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at 
org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:79)
at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:53)
```


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper issue #257: ZOOKEEPER-2784: Add same `sid` config problem check

2017-05-19 Thread asdf2014
Github user asdf2014 commented on the issue:

https://github.com/apache/zookeeper/pull/257
  
I don't understand why `jenkins` reports `UnknownHostException`.

```java
java.net.UnknownHostException: 10.1.1.-113
at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at 
org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:448)
at 
org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:491)
at 
org.apache.zookeeper.server.quorum.QuorumCnxManager.toSend(QuorumCnxManager.java:426)
at 
org.apache.zookeeper.test.CnxManagerTest.testCnxManagerTimeout(CnxManagerTest.java:212)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at 
org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:79)
at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:53)
```


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread Hadoop QA (JIRA)

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

Hadoop QA commented on ZOOKEEPER-2784:
--

-1 overall.  GitHub Pull Request  Build
  

+1 @author.  The patch does not contain any @author tags.

+1 tests included.  The patch appears to include 6 new or modified tests.

+1 javadoc.  The javadoc tool did not generate any warning messages.

+1 javac.  The applied patch does not increase the total number of javac 
compiler warnings.

+1 findbugs.  The patch does not introduce any new Findbugs (version 3.0.1) 
warnings.

+1 release audit.  The applied patch does not increase the total number of 
release audit warnings.

-1 core tests.  The patch failed core unit tests.

+1 contrib tests.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/722//testReport/
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/722//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/722//console

This message is automatically generated.

> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


Failed: ZOOKEEPER- PreCommit Build #722

2017-05-19 Thread Apache Jenkins Server
Build: https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/722/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 67.69 MB...]
 [exec] 
 [exec] +1 javadoc.  The javadoc tool did not generate any warning 
messages.
 [exec] 
 [exec] +1 javac.  The applied patch does not increase the total number 
of javac compiler warnings.
 [exec] 
 [exec] +1 findbugs.  The patch does not introduce any new Findbugs 
(version 3.0.1) warnings.
 [exec] 
 [exec] +1 release audit.  The applied patch does not increase the 
total number of release audit warnings.
 [exec] 
 [exec] -1 core tests.  The patch failed core unit tests.
 [exec] 
 [exec] +1 contrib tests.  The patch passed contrib unit tests.
 [exec] 
 [exec] Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/722//testReport/
 [exec] Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/722//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
 [exec] Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/722//console
 [exec] 
 [exec] This message is automatically generated.
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Adding comment to Jira.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] Comment added.
 [exec] 0273f01eca321a497916eeacbe383c526d8e logged out
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Finished build.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] mv: 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 and 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 are the same file

BUILD FAILED
/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/build.xml:1642:
 exec returned: 1

Total time: 16 minutes 21 seconds
Build step 'Execute shell' marked build as failure
Archiving artifacts
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Compressed 576.65 KB of artifacts by 44.4% relative to #718
Recording test results
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
[description-setter] Description set: ZOOKEEPER-2784
Putting comment on the pull request
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7



###
## FAILED TESTS (if any) 
##
1 tests failed.
FAILED:  org.apache.zookeeper.test.CnxManagerTest.testSameSID

Error Message:
Connection refused

Stack Trace:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at 
org.apache.zookeeper.test.CnxManagerTest.testSameSID(CnxManagerTest.java:394)
at 
org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:79)

Failed: ZOOKEEPER- PreCommit Build #721

2017-05-19 Thread Apache Jenkins Server
Build: https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/721/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 67.99 MB...]
 [exec] 
 [exec] +1 javadoc.  The javadoc tool did not generate any warning 
messages.
 [exec] 
 [exec] +1 javac.  The applied patch does not increase the total number 
of javac compiler warnings.
 [exec] 
 [exec] +1 findbugs.  The patch does not introduce any new Findbugs 
(version 3.0.1) warnings.
 [exec] 
 [exec] +1 release audit.  The applied patch does not increase the 
total number of release audit warnings.
 [exec] 
 [exec] -1 core tests.  The patch failed core unit tests.
 [exec] 
 [exec] +1 contrib tests.  The patch passed contrib unit tests.
 [exec] 
 [exec] Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/721//testReport/
 [exec] Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/721//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
 [exec] Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/721//console
 [exec] 
 [exec] This message is automatically generated.
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Adding comment to Jira.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] Comment added.
 [exec] 3fb55315237a8b3b026a3f966ecc62f471d60d5f logged out
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Finished build.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] mv: 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 and 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 are the same file

BUILD FAILED
/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/build.xml:1642:
 exec returned: 1

Total time: 13 minutes 48 seconds
Build step 'Execute shell' marked build as failure
Archiving artifacts
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Compressed 576.65 KB of artifacts by 44.4% relative to #718
Recording test results
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
[description-setter] Description set: ZOOKEEPER-2784
Putting comment on the pull request
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7



###
## FAILED TESTS (if any) 
##
1 tests failed.
FAILED:  org.apache.zookeeper.test.CnxManagerTest.testSameSID

Error Message:
Connection refused

Stack Trace:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at 
org.apache.zookeeper.test.CnxManagerTest.testSameSID(CnxManagerTest.java:394)
at 
org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:79)

[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117600833
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -310,8 +311,8 @@ public boolean initiateConnection(Socket sock, Long 
sid) {
  * possible long value to lose the challenge.
  *
  */
-public void receiveConnection(Socket sock) {
-Long sid = null, protocolVersion = null;
+public void receiveConnection(Socket sock) throws ConfigException {
+Long sid, protocolVersion;
--- End diff --

You are right. I will change it into `long` instead of `Long`.


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread asdf2014
Github user asdf2014 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117600833
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -310,8 +311,8 @@ public boolean initiateConnection(Socket sock, Long 
sid) {
  * possible long value to lose the challenge.
  *
  */
-public void receiveConnection(Socket sock) {
-Long sid = null, protocolVersion = null;
+public void receiveConnection(Socket sock) throws ConfigException {
+Long sid, protocolVersion;
--- End diff --

You are right. I will change it into `long` instead of `Long`.


---
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 #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread eribeiro
Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117600729
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -310,8 +311,8 @@ public boolean initiateConnection(Socket sock, Long 
sid) {
  * possible long value to lose the challenge.
  *
  */
-public void receiveConnection(Socket sock) {
-Long sid = null, protocolVersion = null;
+public void receiveConnection(Socket sock) throws ConfigException {
+Long sid, protocolVersion;
--- End diff --

Yes, integers whose values are between -127 and 128 (inclusive) are cached 
inside Integer object.

Plus, boxing/unboxing in a tight loop (not the case here!) can be a huge 
performance pitfall. For example:

```
for (Integer it = 0; it < 1; ){
   it += 1;
}
```
Used to have abysmal performance numbers due to many auto boxing/unboxing .


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117600729
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -310,8 +311,8 @@ public boolean initiateConnection(Socket sock, Long 
sid) {
  * possible long value to lose the challenge.
  *
  */
-public void receiveConnection(Socket sock) {
-Long sid = null, protocolVersion = null;
+public void receiveConnection(Socket sock) throws ConfigException {
+Long sid, protocolVersion;
--- End diff --

Yes, integers whose values are between -127 and 128 (inclusive) are cached 
inside Integer object.

Plus, boxing/unboxing in a tight loop (not the case here!) can be a huge 
performance pitfall. For example:

```
for (Integer it = 0; it < 1; ){
   it += 1;
}
```
Used to have abysmal performance numbers due to many auto boxing/unboxing .


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117600609
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -620,6 +625,7 @@ public void run() {
 int numRetries = 0;
 InetSocketAddress addr;
 Socket client = null;
+ConfigException ce = null;
--- End diff --

Okay!


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread asdf2014
Github user asdf2014 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117600609
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -620,6 +625,7 @@ public void run() {
 int numRetries = 0;
 InetSocketAddress addr;
 Socket client = null;
+ConfigException ce = null;
--- End diff --

Okay!


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117600572
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -620,6 +625,7 @@ public void run() {
 int numRetries = 0;
 InetSocketAddress addr;
 Socket client = null;
+ConfigException ce = null;
--- End diff --

+1 about `configException` :+1:


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread eribeiro
Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117600572
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -620,6 +625,7 @@ public void run() {
 int numRetries = 0;
 InetSocketAddress addr;
 Socket client = null;
+ConfigException ce = null;
--- End diff --

+1 about `configException` :+1:


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117600503
  
--- Diff: src/java/test/org/apache/zookeeper/test/CnxManagerTest.java ---
@@ -351,15 +351,55 @@ public void testSocketTimeout() throws Exception {
 LOG.info("Election port: " + port);
 Thread.sleep(1000);
 
-Socket sock = new Socket();
-sock.connect(peers.get(1L).electionAddr, 5000);
-long begin = Time.currentElapsedTime();
-// Read without sending data. Verify timeout.
-cnxManager.receiveConnection(sock);
-long end = Time.currentElapsedTime();
-if((end - begin) > ((peer.getSyncLimit() * peer.getTickTime()) + 
500)) Assert.fail("Waited more than necessary");
-cnxManager.halt();
-Assert.assertFalse(cnxManager.listener.isAlive());
+try (Socket sock = new Socket()) {
+sock.connect(peers.get(1L).electionAddr, 5000);
+long begin = Time.currentElapsedTime();
+// Read without sending data. Verify timeout.
+cnxManager.receiveConnection(sock);
+long end = Time.currentElapsedTime();
+if ((end - begin) > ((peer.getSyncLimit() * 
peer.getTickTime()) + 500))
+Assert.fail("Waited more than necessary");
+cnxManager.halt();
+Assert.assertFalse(cnxManager.listener.isAlive());
+}
+}
+
+/*
+ * Test if a duplicate SID appears in the cluster
+ */
+@Test
+public void testSameSID() throws Exception {
+QuorumPeer peer = new QuorumPeer(peers, peerTmpdir[2], 
peerTmpdir[2], peerClientPort[2], 3, 2, 2000, 2, 2);
+QuorumCnxManager cnxManager = new QuorumCnxManager(peer);
+QuorumCnxManager.Listener listener = cnxManager.listener;
+if (listener != null) {
+Thread.UncaughtExceptionHandler handler = new 
Thread.UncaughtExceptionHandler() {
+@Override
+public void uncaughtException(Thread th, Throwable ex) {
+if (ex instanceof RuntimeException) {
+String msg = ex.getMessage();
+LOG.error(msg);
+
Assert.assertEquals("org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException:"
 +
+" Appearing duplicate SID: 2", msg);
+}
+}
+};
+listener.setUncaughtExceptionHandler(handler);
+listener.start();
+} else {
+LOG.error("Null listener when initializing cnx manager");
+}
+try (Socket sock = new Socket()) {
+InetSocketAddress electionAddr = 
peers.get(peer.getId()).electionAddr;
+LOG.info("Creating socket connection, host: {}, port: {}",
+electionAddr.getHostString(), electionAddr.getPort());
+sock.connect(electionAddr, 3);
--- End diff --

I want to fix the `Connection Refused`. I thought the environment `jenkins` 
is not stable...


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread asdf2014
Github user asdf2014 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117600503
  
--- Diff: src/java/test/org/apache/zookeeper/test/CnxManagerTest.java ---
@@ -351,15 +351,55 @@ public void testSocketTimeout() throws Exception {
 LOG.info("Election port: " + port);
 Thread.sleep(1000);
 
-Socket sock = new Socket();
-sock.connect(peers.get(1L).electionAddr, 5000);
-long begin = Time.currentElapsedTime();
-// Read without sending data. Verify timeout.
-cnxManager.receiveConnection(sock);
-long end = Time.currentElapsedTime();
-if((end - begin) > ((peer.getSyncLimit() * peer.getTickTime()) + 
500)) Assert.fail("Waited more than necessary");
-cnxManager.halt();
-Assert.assertFalse(cnxManager.listener.isAlive());
+try (Socket sock = new Socket()) {
+sock.connect(peers.get(1L).electionAddr, 5000);
+long begin = Time.currentElapsedTime();
+// Read without sending data. Verify timeout.
+cnxManager.receiveConnection(sock);
+long end = Time.currentElapsedTime();
+if ((end - begin) > ((peer.getSyncLimit() * 
peer.getTickTime()) + 500))
+Assert.fail("Waited more than necessary");
+cnxManager.halt();
+Assert.assertFalse(cnxManager.listener.isAlive());
+}
+}
+
+/*
+ * Test if a duplicate SID appears in the cluster
+ */
+@Test
+public void testSameSID() throws Exception {
+QuorumPeer peer = new QuorumPeer(peers, peerTmpdir[2], 
peerTmpdir[2], peerClientPort[2], 3, 2, 2000, 2, 2);
+QuorumCnxManager cnxManager = new QuorumCnxManager(peer);
+QuorumCnxManager.Listener listener = cnxManager.listener;
+if (listener != null) {
+Thread.UncaughtExceptionHandler handler = new 
Thread.UncaughtExceptionHandler() {
+@Override
+public void uncaughtException(Thread th, Throwable ex) {
+if (ex instanceof RuntimeException) {
+String msg = ex.getMessage();
+LOG.error(msg);
+
Assert.assertEquals("org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException:"
 +
+" Appearing duplicate SID: 2", msg);
+}
+}
+};
+listener.setUncaughtExceptionHandler(handler);
+listener.start();
+} else {
+LOG.error("Null listener when initializing cnx manager");
+}
+try (Socket sock = new Socket()) {
+InetSocketAddress electionAddr = 
peers.get(peer.getId()).electionAddr;
+LOG.info("Creating socket connection, host: {}, port: {}",
+electionAddr.getHostString(), electionAddr.getPort());
+sock.connect(electionAddr, 3);
--- End diff --

I want to fix the `Connection Refused`. I thought the environment `jenkins` 
is not stable...


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117600449
  
--- Diff: src/java/test/org/apache/zookeeper/test/CnxManagerTest.java ---
@@ -351,15 +351,55 @@ public void testSocketTimeout() throws Exception {
 LOG.info("Election port: " + port);
 Thread.sleep(1000);
 
-Socket sock = new Socket();
-sock.connect(peers.get(1L).electionAddr, 5000);
-long begin = Time.currentElapsedTime();
-// Read without sending data. Verify timeout.
-cnxManager.receiveConnection(sock);
-long end = Time.currentElapsedTime();
-if((end - begin) > ((peer.getSyncLimit() * peer.getTickTime()) + 
500)) Assert.fail("Waited more than necessary");
-cnxManager.halt();
-Assert.assertFalse(cnxManager.listener.isAlive());
+try (Socket sock = new Socket()) {
--- End diff --

Okay! I will separate it into a different `jira`.


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread asdf2014
Github user asdf2014 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117600449
  
--- Diff: src/java/test/org/apache/zookeeper/test/CnxManagerTest.java ---
@@ -351,15 +351,55 @@ public void testSocketTimeout() throws Exception {
 LOG.info("Election port: " + port);
 Thread.sleep(1000);
 
-Socket sock = new Socket();
-sock.connect(peers.get(1L).electionAddr, 5000);
-long begin = Time.currentElapsedTime();
-// Read without sending data. Verify timeout.
-cnxManager.receiveConnection(sock);
-long end = Time.currentElapsedTime();
-if((end - begin) > ((peer.getSyncLimit() * peer.getTickTime()) + 
500)) Assert.fail("Waited more than necessary");
-cnxManager.halt();
-Assert.assertFalse(cnxManager.listener.isAlive());
+try (Socket sock = new Socket()) {
--- End diff --

Okay! I will separate it into a different `jira`.


---
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 #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread asdf2014
Github user asdf2014 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117600411
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -677,6 +686,7 @@ public void run() {
 LOG.debug("Error closing server socket", ie);
 }
 }
+if (ce !=null) throw new RuntimeException(ce);
--- End diff --

Thx a lot! I will using `finally` deal with closing `socket`.


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117600411
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -677,6 +686,7 @@ public void run() {
 LOG.debug("Error closing server socket", ie);
 }
 }
+if (ce !=null) throw new RuntimeException(ce);
--- End diff --

Thx a lot! I will using `finally` deal with closing `socket`.


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117600362
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -657,9 +663,12 @@ public void run() {
 LOG.error("Error closing server socket", ie);
 } catch (InterruptedException ie) {
 LOG.error("Interrupted while sleeping. " +
-"Ignoring exception", ie);
+"Ignoring exception", ie);
 }
 closeSocket(client);
+} catch (ConfigException e) {
+LOG.error(e.getMessage());
+ce = e;
--- End diff --

Great! I will fix it.


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread asdf2014
Github user asdf2014 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117600362
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -657,9 +663,12 @@ public void run() {
 LOG.error("Error closing server socket", ie);
 } catch (InterruptedException ie) {
 LOG.error("Interrupted while sleeping. " +
-"Ignoring exception", ie);
+"Ignoring exception", ie);
 }
 closeSocket(client);
+} catch (ConfigException e) {
+LOG.error(e.getMessage());
+ce = e;
--- End diff --

Great! I will fix it.


---
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_branch34_jdk7 - Build # 1518 - Failure

2017-05-19 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper_branch34_jdk7/1518/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 31.15 MB...]
[junit] 2017-05-20 02:51:19,487 [myid:] - INFO  
[main:PrepRequestProcessor@766] - Shutting down
[junit] 2017-05-20 02:51:19,487 [myid:] - INFO  
[main:SyncRequestProcessor@208] - Shutting down
[junit] 2017-05-20 02:51:19,487 [myid:] - INFO  [ProcessThread(sid:0 
cport:11221)::PrepRequestProcessor@144] - PrepRequestProcessor exited loop!
[junit] 2017-05-20 02:51:19,488 [myid:] - INFO  
[SyncThread:0:SyncRequestProcessor@186] - SyncRequestProcessor exited!
[junit] 2017-05-20 02:51:19,488 [myid:] - INFO  
[main:FinalRequestProcessor@403] - shutdown of request processor complete
[junit] 2017-05-20 02:51:19,489 [myid:] - INFO  
[main:FourLetterWordMain@62] - connecting to 127.0.0.1 11221
[junit] 2017-05-20 02:51:19,489 [myid:] - INFO  [main:JMXEnv@147] - 
ensureOnly:[]
[junit] 2017-05-20 02:51:19,491 [myid:] - INFO  [main:ClientBase@470] - 
STARTING server
[junit] 2017-05-20 02:51:19,491 [myid:] - INFO  [main:ClientBase@391] - 
CREATING server instance 127.0.0.1:11221
[junit] 2017-05-20 02:51:19,492 [myid:] - INFO  
[main:ServerCnxnFactory@111] - Using 
org.apache.zookeeper.server.NIOServerCnxnFactory as server connection factory
[junit] 2017-05-20 02:51:19,492 [myid:] - INFO  
[main:NIOServerCnxnFactory@89] - binding to port 0.0.0.0/0.0.0.0:11221
[junit] 2017-05-20 02:51:19,492 [myid:] - INFO  [main:ClientBase@366] - 
STARTING server instance 127.0.0.1:11221
[junit] 2017-05-20 02:51:19,493 [myid:] - INFO  [main:ZooKeeperServer@173] 
- Created server with tickTime 3000 minSessionTimeout 6000 maxSessionTimeout 
6 datadir 
/home/jenkins/jenkins-slave/workspace/ZooKeeper_branch34_jdk7/build/test/tmp/test9204365719096612263.junit.dir/version-2
 snapdir 
/home/jenkins/jenkins-slave/workspace/ZooKeeper_branch34_jdk7/build/test/tmp/test9204365719096612263.junit.dir/version-2
[junit] 2017-05-20 02:51:19,497 [myid:] - ERROR [main:ZooKeeperServer@468] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-05-20 02:51:19,498 [myid:] - INFO  
[main:FourLetterWordMain@62] - connecting to 127.0.0.1 11221
[junit] 2017-05-20 02:51:19,498 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11221:NIOServerCnxnFactory@192] - 
Accepted socket connection from /127.0.0.1:36014
[junit] 2017-05-20 02:51:19,499 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11221:NIOServerCnxn@883] - Processing 
stat command from /127.0.0.1:36014
[junit] 2017-05-20 02:51:19,499 [myid:] - INFO  
[Thread-4:NIOServerCnxn$StatCommand@674] - Stat command output
[junit] 2017-05-20 02:51:19,500 [myid:] - INFO  
[Thread-4:NIOServerCnxn@1044] - Closed socket connection for client 
/127.0.0.1:36014 (no session established for client)
[junit] 2017-05-20 02:51:19,500 [myid:] - INFO  [main:JMXEnv@230] - 
ensureParent:[InMemoryDataTree, StandaloneServer_port]
[junit] 2017-05-20 02:51:19,502 [myid:] - INFO  [main:JMXEnv@247] - 
expect:InMemoryDataTree
[junit] 2017-05-20 02:51:19,502 [myid:] - INFO  [main:JMXEnv@251] - 
found:InMemoryDataTree 
org.apache.ZooKeeperService:name0=StandaloneServer_port11221,name1=InMemoryDataTree
[junit] 2017-05-20 02:51:19,503 [myid:] - INFO  [main:JMXEnv@247] - 
expect:StandaloneServer_port
[junit] 2017-05-20 02:51:19,503 [myid:] - INFO  [main:JMXEnv@251] - 
found:StandaloneServer_port 
org.apache.ZooKeeperService:name0=StandaloneServer_port11221
[junit] 2017-05-20 02:51:19,503 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@58] - Memory used 35688
[junit] 2017-05-20 02:51:19,504 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@63] - Number of threads 20
[junit] 2017-05-20 02:51:19,504 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@78] - FINISHED TEST METHOD testQuota
[junit] 2017-05-20 02:51:19,504 [myid:] - INFO  [main:ClientBase@547] - 
tearDown starting
[junit] 2017-05-20 02:51:19,567 [myid:] - INFO  [main:ZooKeeper@684] - 
Session: 0x1007b31a54a closed
[junit] 2017-05-20 02:51:19,568 [myid:] - INFO  
[main-EventThread:ClientCnxn$EventThread@520] - EventThread shut down for 
session: 0x1007b31a54a
[junit] 2017-05-20 02:51:19,568 [myid:] - INFO  [main:ClientBase@517] - 
STOPPING server
[junit] 2017-05-20 02:51:19,568 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11221:NIOServerCnxnFactory@219] - 
NIOServerCnxn factory exited run method
[junit] 2017-05-20 02:51:19,569 [myid:] - INFO  [main:ZooKeeperServer@501] 
- shutting down
[junit] 2017-05-20 02:51:19,569 [myid:] - ERROR [main:ZooKeeperServer@468] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR 

[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117600268
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -620,6 +625,7 @@ public void run() {
 int numRetries = 0;
 InetSocketAddress addr;
 Socket client = null;
+ConfigException ce = null;
--- End diff --

Using `configExceptioin`?


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread asdf2014
Github user asdf2014 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117600268
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -620,6 +625,7 @@ public void run() {
 int numRetries = 0;
 InetSocketAddress addr;
 Socket client = null;
+ConfigException ce = null;
--- End diff --

Using `configExceptioin`?


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117600247
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -18,6 +18,12 @@
 
 package org.apache.zookeeper.server.quorum;
 
+import org.apache.zookeeper.server.ZooKeeperThread;
--- End diff --

Thank you! I will pay attention. :D


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread asdf2014
Github user asdf2014 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117600247
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -18,6 +18,12 @@
 
 package org.apache.zookeeper.server.quorum;
 
+import org.apache.zookeeper.server.ZooKeeperThread;
--- End diff --

Thank you! I will pay attention. :D


---
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 #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread asdf2014
Github user asdf2014 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117600228
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -657,9 +663,12 @@ public void run() {
 LOG.error("Error closing server socket", ie);
 } catch (InterruptedException ie) {
 LOG.error("Interrupted while sleeping. " +
-"Ignoring exception", ie);
+"Ignoring exception", ie);
--- End diff --

Thanks! I will roll it back.


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117600228
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -657,9 +663,12 @@ public void run() {
 LOG.error("Error closing server socket", ie);
 } catch (InterruptedException ie) {
 LOG.error("Interrupted while sleeping. " +
-"Ignoring exception", ie);
+"Ignoring exception", ie);
--- End diff --

Thanks! I will roll it back.


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117600150
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -371,6 +372,10 @@ public void receiveConnection(Socket sock) {
 connectOne(sid);
 }
 
+}else if (sid == self.getId()) {
+closeSocket(sock);
+throw new ConfigException(String.format("Appearing duplicate 
SID: %s", sid));
--- End diff --

Great! I will change it.


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread asdf2014
Github user asdf2014 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117600150
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -371,6 +372,10 @@ public void receiveConnection(Socket sock) {
 connectOne(sid);
 }
 
+}else if (sid == self.getId()) {
+closeSocket(sock);
+throw new ConfigException(String.format("Appearing duplicate 
SID: %s", sid));
--- End diff --

Great! I will change it.


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117600142
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
@@ -545,6 +545,7 @@ public void testInconsistentPeerType() throws Exception 
{
 defaultedToObserver = true;
 }
 if (warningPresent && defaultedToObserver) {
+LOG.debug("Content from console is: {}", line);
--- End diff --

"QuorumPeerMainTest" has no reason to fail in `jinkens`, so add a logger to 
figure out why. I will remove it.


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread asdf2014
Github user asdf2014 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117600142
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
@@ -545,6 +545,7 @@ public void testInconsistentPeerType() throws Exception 
{
 defaultedToObserver = true;
 }
 if (warningPresent && defaultedToObserver) {
+LOG.debug("Content from console is: {}", line);
--- End diff --

"QuorumPeerMainTest" has no reason to fail in `jinkens`, so add a logger to 
figure out why. I will remove it.


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117599897
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -371,6 +372,10 @@ public void receiveConnection(Socket sock) {
 connectOne(sid);
 }
 
+}else if (sid == self.getId()) {
--- End diff --

Thanks! I will fix it.


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread asdf2014
Github user asdf2014 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117599897
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -371,6 +372,10 @@ public void receiveConnection(Socket sock) {
 connectOne(sid);
 }
 
+}else if (sid == self.getId()) {
--- End diff --

Thanks! I will fix it.


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117599887
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -310,8 +311,8 @@ public boolean initiateConnection(Socket sock, Long 
sid) {
  * possible long value to lose the challenge.
  *
  */
-public void receiveConnection(Socket sock) {
-Long sid = null, protocolVersion = null;
+public void receiveConnection(Socket sock) throws ConfigException {
+Long sid, protocolVersion;
--- End diff --

Yeah, actually it could be a problem. `Long == Long` will call 
`Long.valueof` method, and compare the address of Object. And the 
`Long.valueof` method will create a new `Long` Object when the value of `Long` 
Object more than 127. So, it could return the `false`.
```java
/*
127L == 127L: true
128L == 128L: false
128L equals 128L: true
127 == 127: true
128 == 128: true
 */
public static void main(String... args) {
Long l1 = 127L, l2 = 127L, l3 = 128L, l4 = 128L;
System.out.println("127L == 127L: " + (l1 == l2));
System.out.println("128L == 128L: " + (l3 == l4));
System.out.println("128L equals 128L: " + (l3.equals(l4)));
long ll1 = 127, ll2 = 127, ll3 = 128, ll4 = 128;
System.out.println("127 == 127: " + (ll1 == ll2));
System.out.println("128 == 128: " + (ll3 == ll4));
}
```


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread asdf2014
Github user asdf2014 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117599887
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -310,8 +311,8 @@ public boolean initiateConnection(Socket sock, Long 
sid) {
  * possible long value to lose the challenge.
  *
  */
-public void receiveConnection(Socket sock) {
-Long sid = null, protocolVersion = null;
+public void receiveConnection(Socket sock) throws ConfigException {
+Long sid, protocolVersion;
--- End diff --

Yeah, actually it could be a problem. `Long == Long` will call 
`Long.valueof` method, and compare the address of Object. And the 
`Long.valueof` method will create a new `Long` Object when the value of `Long` 
Object more than 127. So, it could return the `false`.
```java
/*
127L == 127L: true
128L == 128L: false
128L equals 128L: true
127 == 127: true
128 == 128: true
 */
public static void main(String... args) {
Long l1 = 127L, l2 = 127L, l3 = 128L, l4 = 128L;
System.out.println("127L == 127L: " + (l1 == l2));
System.out.println("128L == 128L: " + (l3 == l4));
System.out.println("128L equals 128L: " + (l3.equals(l4)));
long ll1 = 127, ll2 = 127, ll3 = 128, ll4 = 128;
System.out.println("127 == 127: " + (ll1 == ll2));
System.out.println("128 == 128: " + (ll3 == ll4));
}
```


---
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-2778) Potential server deadlock between follower sync with leader and follower receiving external connection requests.

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/247#discussion_r117582004
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java 
---
@@ -682,27 +682,19 @@ public void setQuorumAddress(InetSocketAddress addr){
 }
 
 public InetSocketAddress getElectionAddress(){
-synchronized (QV_LOCK) {
-return myElectionAddr;
-}
+return myElectionAddr;
--- End diff --

> All set code path was protected by QV_LOCK already, which implies that 
whoever calls set* should already acquire the QV_LOCK.

Not sure about this one. `setElectionAddress` is called by 
`recreateSocketAddresses` which is called by `QuorumCnxManager#Listener.run` 
without acquiring QV_LOCK. Not sure what the implication of this is. Although I 
believe you are correct about `setClientAddress`.

> if we get out dated addr (in case the current quorum peer is being 
reconfigured) and sent this to another peer, another peer will not able to 
connect but that's fine, it will retry until at certain point later it will get 
correct information.

What is the behavior if we are able to connect to the "incorrect peer". 
Will we eventually disconnect or do we stay connected until reconfiguration 
occurs again?


> Potential server deadlock between follower sync with leader and follower 
> receiving external connection requests.
> 
>
> Key: ZOOKEEPER-2778
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2778
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: quorum
>Affects Versions: 3.5.3
>Reporter: Michael Han
>Assignee: Michael Han
>Priority: Critical
>
> It's possible to have a deadlock during recovery phase. 
> Found this issue by analyzing thread dumps of "flaky" ReconfigRecoveryTest 
> [1]. . Here is a sample thread dump that illustrates the state of the 
> execution:
> {noformat}
> [junit]  java.lang.Thread.State: BLOCKED
> [junit] at  
> org.apache.zookeeper.server.quorum.QuorumPeer.getElectionAddress(QuorumPeer.java:686)
> [junit] at  
> org.apache.zookeeper.server.quorum.QuorumCnxManager.initiateConnection(QuorumCnxManager.java:265)
> [junit] at  
> org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:445)
> [junit] at  
> org.apache.zookeeper.server.quorum.QuorumCnxManager.receiveConnection(QuorumCnxManager.java:369)
> [junit] at  
> org.apache.zookeeper.server.quorum.QuorumCnxManager$Listener.run(QuorumCnxManager.java:642)
> [junit] 
> [junit]  java.lang.Thread.State: BLOCKED
> [junit] at  
> org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:472)
> [junit] at  
> org.apache.zookeeper.server.quorum.QuorumPeer.connectNewPeers(QuorumPeer.java:1438)
> [junit] at  
> org.apache.zookeeper.server.quorum.QuorumPeer.setLastSeenQuorumVerifier(QuorumPeer.java:1471)
> [junit] at  
> org.apache.zookeeper.server.quorum.Learner.syncWithLeader(Learner.java:520)
> [junit] at  
> org.apache.zookeeper.server.quorum.Follower.followLeader(Follower.java:88)
> [junit] at  
> org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:1133)
> {noformat}
> The dead lock happens between the quorum peer thread which running the 
> follower that doing sync with leader work, and the listener of the qcm of the 
> same quorum peer that doing the receiving connection work. Basically to 
> finish sync with leader, the follower needs to synchronize on both QV_LOCK 
> and the qmc object it owns; while in the receiver thread to finish setup an 
> incoming connection the thread needs to synchronize on both the qcm object 
> the quorum peer owns, and the same QV_LOCK. It's easy to see the problem here 
> is the order of acquiring two locks are different, thus depends on timing / 
> actual execution order, two threads might end up acquiring one lock while 
> holding another.
> [1] 
> org.apache.zookeeper.server.quorum.ReconfigRecoveryTest.testCurrentServersAreObserversInNextConfig



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #247: ZOOKEEPER-2778: Potential server deadlock betwe...

2017-05-19 Thread afine
Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/247#discussion_r117582004
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java 
---
@@ -682,27 +682,19 @@ public void setQuorumAddress(InetSocketAddress addr){
 }
 
 public InetSocketAddress getElectionAddress(){
-synchronized (QV_LOCK) {
-return myElectionAddr;
-}
+return myElectionAddr;
--- End diff --

> All set code path was protected by QV_LOCK already, which implies that 
whoever calls set* should already acquire the QV_LOCK.

Not sure about this one. `setElectionAddress` is called by 
`recreateSocketAddresses` which is called by `QuorumCnxManager#Listener.run` 
without acquiring QV_LOCK. Not sure what the implication of this is. Although I 
believe you are correct about `setClientAddress`.

> if we get out dated addr (in case the current quorum peer is being 
reconfigured) and sent this to another peer, another peer will not able to 
connect but that's fine, it will retry until at certain point later it will get 
correct information.

What is the behavior if we are able to connect to the "incorrect peer". 
Will we eventually disconnect or do we stay connected until reconfiguration 
occurs again?


---
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] [Updated] (ZOOKEEPER-2750) Document SSL Support for Atomic Broadcast protocol

2017-05-19 Thread Abraham Fine (JIRA)

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

Abraham Fine updated ZOOKEEPER-2750:

Attachment: ZooKeeperSSLUserGuide.pdf

Suggested changes to ZooKeeper wiki

> Document SSL Support for Atomic Broadcast protocol
> --
>
> Key: ZOOKEEPER-2750
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2750
> Project: ZooKeeper
>  Issue Type: Bug
>Reporter: Abraham Fine
>Assignee: Abraham Fine
> Attachments: ZooKeeperSSLUserGuide.pdf
>
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117574653
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -371,6 +372,10 @@ public void receiveConnection(Socket sock) {
 connectOne(sid);
 }
 
+}else if (sid == self.getId()) {
+closeSocket(sock);
+throw new ConfigException(String.format("Appearing duplicate 
SID: %s", sid));
--- End diff --

I think this message could be more descriptive or reshaped. English is not 
my 1st language, but what about _"Inconsistent ensemble setup: duplicate SID %s 
found"?_


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread eribeiro
Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117574653
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -371,6 +372,10 @@ public void receiveConnection(Socket sock) {
 connectOne(sid);
 }
 
+}else if (sid == self.getId()) {
+closeSocket(sock);
+throw new ConfigException(String.format("Appearing duplicate 
SID: %s", sid));
--- End diff --

I think this message could be more descriptive or reshaped. English is not 
my 1st language, but what about _"Inconsistent ensemble setup: duplicate SID %s 
found"?_


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117565584
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -657,9 +663,12 @@ public void run() {
 LOG.error("Error closing server socket", ie);
 } catch (InterruptedException ie) {
 LOG.error("Interrupted while sleeping. " +
-"Ignoring exception", ie);
+"Ignoring exception", ie);
--- End diff --

nit: whitespace change


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117565417
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -620,6 +625,7 @@ public void run() {
 int numRetries = 0;
 InetSocketAddress addr;
 Socket client = null;
+ConfigException ce = null;
--- End diff --

nit: can we use better variable naming?


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117565984
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -677,6 +686,7 @@ public void run() {
 LOG.debug("Error closing server socket", ie);
 }
 }
+if (ce !=null) throw new RuntimeException(ce);
--- End diff --

Would it be possible to refactor this so the exception never leaves its 
catch block? Perhaps the logic "in between" can be captured with "finally". 
Then I think we will fix 
https://github.com/apache/zookeeper/pull/257/files#r117407300 as well.


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117560586
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -18,6 +18,12 @@
 
 package org.apache.zookeeper.server.quorum;
 
+import org.apache.zookeeper.server.ZooKeeperThread;
--- End diff --

a few unnecessary reordering of imports, these should be kept to a minimum 
to keep the diff clean


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117566584
  
--- Diff: src/java/test/org/apache/zookeeper/test/CnxManagerTest.java ---
@@ -351,15 +351,55 @@ public void testSocketTimeout() throws Exception {
 LOG.info("Election port: " + port);
 Thread.sleep(1000);
 
-Socket sock = new Socket();
-sock.connect(peers.get(1L).electionAddr, 5000);
-long begin = Time.currentElapsedTime();
-// Read without sending data. Verify timeout.
-cnxManager.receiveConnection(sock);
-long end = Time.currentElapsedTime();
-if((end - begin) > ((peer.getSyncLimit() * peer.getTickTime()) + 
500)) Assert.fail("Waited more than necessary");
-cnxManager.halt();
-Assert.assertFalse(cnxManager.listener.isAlive());
+try (Socket sock = new Socket()) {
--- End diff --

+1, although please feel free to submit a jira and fix it there!


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread afine
Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117566584
  
--- Diff: src/java/test/org/apache/zookeeper/test/CnxManagerTest.java ---
@@ -351,15 +351,55 @@ public void testSocketTimeout() throws Exception {
 LOG.info("Election port: " + port);
 Thread.sleep(1000);
 
-Socket sock = new Socket();
-sock.connect(peers.get(1L).electionAddr, 5000);
-long begin = Time.currentElapsedTime();
-// Read without sending data. Verify timeout.
-cnxManager.receiveConnection(sock);
-long end = Time.currentElapsedTime();
-if((end - begin) > ((peer.getSyncLimit() * peer.getTickTime()) + 
500)) Assert.fail("Waited more than necessary");
-cnxManager.halt();
-Assert.assertFalse(cnxManager.listener.isAlive());
+try (Socket sock = new Socket()) {
--- End diff --

+1, although please feel free to submit a jira and fix it there!


---
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 #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread afine
Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117560586
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -18,6 +18,12 @@
 
 package org.apache.zookeeper.server.quorum;
 
+import org.apache.zookeeper.server.ZooKeeperThread;
--- End diff --

a few unnecessary reordering of imports, these should be kept to a minimum 
to keep the diff clean


---
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 #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread afine
Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117565984
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -677,6 +686,7 @@ public void run() {
 LOG.debug("Error closing server socket", ie);
 }
 }
+if (ce !=null) throw new RuntimeException(ce);
--- End diff --

Would it be possible to refactor this so the exception never leaves its 
catch block? Perhaps the logic "in between" can be captured with "finally". 
Then I think we will fix 
https://github.com/apache/zookeeper/pull/257/files#r117407300 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.
---


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread afine
Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117565584
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -657,9 +663,12 @@ public void run() {
 LOG.error("Error closing server socket", ie);
 } catch (InterruptedException ie) {
 LOG.error("Interrupted while sleeping. " +
-"Ignoring exception", ie);
+"Ignoring exception", ie);
--- End diff --

nit: whitespace 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.
---


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread afine
Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117565417
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -620,6 +625,7 @@ public void run() {
 int numRetries = 0;
 InetSocketAddress addr;
 Socket client = null;
+ConfigException ce = null;
--- End diff --

nit: can we use better variable naming?


---
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 issue #167: commitProcessor does not crash when an unseen commit s...

2017-05-19 Thread nerdyyatrice
Github user nerdyyatrice commented on the issue:

https://github.com/apache/zookeeper/pull/167
  
Thanks Han, will do.  so do I still need to re-kick the Jenkins job?

> On May 19, 2017, at 9:44 AM, Michael Han  wrote:
> 
> noCrashOnCommittedRequestsOfUnSeenRequestTest is failing here, please 
investigate.
> 
https://builds.apache.org/job/ZooKeeper_UT_StressTest/4152/testReport/junit/org.apache.zookeeper.server.quorum/CommitProcessorConcurrencyTest/noCrashOnCommittedRequestsOfUnSeenRequestTest/
 

> (This is a Jenkins job I set up to stress test unit test for specific 
pull request branch).
> 
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub 
, or mute 
the thread 
.
> 




---
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-2786) Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

2017-05-19 Thread Hadoop QA (JIRA)

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

Hadoop QA commented on ZOOKEEPER-2786:
--

-1 overall.  GitHub Pull Request  Build
  

+1 @author.  The patch does not contain any @author tags.

+1 tests included.  The patch appears to include 3 new or modified tests.

-1 javadoc.  The javadoc tool appears to have generated 1 warning messages.

+1 javac.  The applied patch does not increase the total number of javac 
compiler warnings.

-1 findbugs.  The patch appears to introduce 90 new Findbugs (version 
3.0.1) warnings.

+1 release audit.  The applied patch does not increase the total number of 
release audit warnings.

+1 core tests.  The patch passed core unit tests.

+1 contrib tests.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/720//testReport/
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/720//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/720//console

This message is automatically generated.

> Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode
> --
>
> Key: ZOOKEEPER-2786
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2786
> Project: ZooKeeper
>  Issue Type: Bug
>Affects Versions: 3.4.10, 3.5.3
>Reporter: Abraham Fine
>Assignee: Abraham Fine
>
> This test is broken on 3.4 and 3.5, but is broken in "different" ways. Please 
> see the individual pull requests for detailed descriptions for the issues 
> faced in both branches.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


Failed: ZOOKEEPER- PreCommit Build #720

2017-05-19 Thread Apache Jenkins Server
Build: https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/720/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 34.32 MB...]
 [exec] +1 tests included.  The patch appears to include 3 new or 
modified tests.
 [exec] 
 [exec] -1 javadoc.  The javadoc tool appears to have generated 1 
warning messages.
 [exec] 
 [exec] +1 javac.  The applied patch does not increase the total number 
of javac compiler warnings.
 [exec] 
 [exec] -1 findbugs.  The patch appears to introduce 90 new Findbugs 
(version 3.0.1) warnings.
 [exec] 
 [exec] +1 release audit.  The applied patch does not increase the 
total number of release audit warnings.
 [exec] 
 [exec] +1 core tests.  The patch passed core unit tests.
 [exec] 
 [exec] +1 contrib tests.  The patch passed contrib unit tests.
 [exec] 
 [exec] Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/720//testReport/
 [exec] Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/720//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
 [exec] Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/720//console
 [exec] 
 [exec] This message is automatically generated.
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Adding comment to Jira.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] Comment added.
 [exec] 441cf12126d46a537979c2dadb0d5470e4a0b472 logged out
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Finished build.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] mv: 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 and 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 are the same file

BUILD FAILED
/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/build.xml:1703:
 exec returned: 2

Total time: 34 minutes 56 seconds
Build step 'Execute shell' marked build as failure
Archiving artifacts
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Recording test results
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
[description-setter] Description set: ZOOKEEPER-2786
Putting comment on the pull request
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7



###
## FAILED TESTS (if any) 
##
All tests passed

[jira] [Commented] (ZOOKEEPER-2786) Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

2017-05-19 Thread Hadoop QA (JIRA)

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

Hadoop QA commented on ZOOKEEPER-2786:
--

-1 overall.  GitHub Pull Request  Build
  

+1 @author.  The patch does not contain any @author tags.

+1 tests included.  The patch appears to include 6 new or modified tests.

+1 javadoc.  The javadoc tool did not generate any warning messages.

+1 javac.  The applied patch does not increase the total number of javac 
compiler warnings.

+1 findbugs.  The patch does not introduce any new Findbugs (version 3.0.1) 
warnings.

+1 release audit.  The applied patch does not increase the total number of 
release audit warnings.

-1 core tests.  The patch failed core unit tests.

+1 contrib tests.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/719//testReport/
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/719//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/719//console

This message is automatically generated.

> Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode
> --
>
> Key: ZOOKEEPER-2786
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2786
> Project: ZooKeeper
>  Issue Type: Bug
>Affects Versions: 3.4.10, 3.5.3
>Reporter: Abraham Fine
>Assignee: Abraham Fine
>
> This test is broken on 3.4 and 3.5, but is broken in "different" ways. Please 
> see the individual pull requests for detailed descriptions for the issues 
> faced in both branches.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


Failed: ZOOKEEPER- PreCommit Build #719

2017-05-19 Thread Apache Jenkins Server
Build: https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/719/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 68.42 MB...]
 [exec] +1 tests included.  The patch appears to include 6 new or 
modified tests.
 [exec] 
 [exec] +1 javadoc.  The javadoc tool did not generate any warning 
messages.
 [exec] 
 [exec] +1 javac.  The applied patch does not increase the total number 
of javac compiler warnings.
 [exec] 
 [exec] +1 findbugs.  The patch does not introduce any new Findbugs 
(version 3.0.1) warnings.
 [exec] 
 [exec] +1 release audit.  The applied patch does not increase the 
total number of release audit warnings.
 [exec] 
 [exec] -1 core tests.  The patch failed core unit tests.
 [exec] 
 [exec] +1 contrib tests.  The patch passed contrib unit tests.
 [exec] 
 [exec] Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/719//testReport/
 [exec] Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/719//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
 [exec] Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/719//console
 [exec] 
 [exec] This message is automatically generated.
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Adding comment to Jira.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] Comment added.
 [exec] 0e986c13c67bda0a8f2edd29e94f6d13415d6f6b logged out
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Finished build.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] mv: 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 and 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 are the same file

BUILD FAILED
/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/build.xml:1642:
 exec returned: 1

Total time: 18 minutes 9 seconds
Build step 'Execute shell' marked build as failure
Archiving artifacts
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Recording test results
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
[description-setter] Description set: ZOOKEEPER-2786
Putting comment on the pull request
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7



###
## FAILED TESTS (if any) 
##
All tests passed

[jira] [Commented] (ZOOKEEPER-2786) Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

GitHub user afine opened a pull request:

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

ZOOKEEPER-2786: Flaky test: 
org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

On branch 3.4 we attempt to check that an invalid opcode in a request 
causes the server to disconnect the client with:

```
try {
zk.exists("/m1", false);
fail("The connection should have been closed");
} catch (KeeperException.ConnectionLossException expected) {
}
```

This can run into a race with the reconnection logic in 
`ClientCnxn.java`https://github.com/apache/zookeeper/blob/branch-3.4/src/java/main/org/apache/zookeeper/ClientCnxn.java#L1052
 We should use a watcher instead to track disconnects.

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

$ git pull https://github.com/afine/zookeeper ZOOKEEPER-2786

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

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

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

This closes #260






> Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode
> --
>
> Key: ZOOKEEPER-2786
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2786
> Project: ZooKeeper
>  Issue Type: Bug
>Affects Versions: 3.4.10, 3.5.3
>Reporter: Abraham Fine
>Assignee: Abraham Fine
>
> This test is broken on 3.4 and 3.5, but is broken in "different" ways. Please 
> see the individual pull requests for detailed descriptions for the issues 
> faced in both branches.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #260: ZOOKEEPER-2786: Flaky test: org.apache.zookeepe...

2017-05-19 Thread afine
GitHub user afine opened a pull request:

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

ZOOKEEPER-2786: Flaky test: 
org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

On branch 3.4 we attempt to check that an invalid opcode in a request 
causes the server to disconnect the client with:

```
try {
zk.exists("/m1", false);
fail("The connection should have been closed");
} catch (KeeperException.ConnectionLossException expected) {
}
```

This can run into a race with the reconnection logic in 
`ClientCnxn.java`https://github.com/apache/zookeeper/blob/branch-3.4/src/java/main/org/apache/zookeeper/ClientCnxn.java#L1052
 We should use a watcher instead to track disconnects.

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

$ git pull https://github.com/afine/zookeeper ZOOKEEPER-2786

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

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

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

This closes #260






---
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-2786) Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

GitHub user afine opened a pull request:

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

ZOOKEEPER-2786: Flaky test: 
org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

On branch 3.5, testNonExistingOpCode appears to always take 30 seconds to 
execute (far too long): 
https://builds.apache.org/job/ZooKeeper_branch35_jdk7/967/testReport/org.apache.zookeeper.test/ClientTest/testNonExistingOpCode/history/

The reason for this is a call to 
`zk.testableWaitForShutdown(CONNECTION_TIMEOUT)` while waiting for the client 
to disconnect after it sent a request with a bad opcode to the server. The call 
to `testableWaitForShutdown` never actually asserts anything and effectively 
just hangs for CONNECTION_TIMEOUT (30 seconds) and returns because the client 
reconnects to the server. 

This patch replaces `zk.testableWaitForShutdown(CONNECTION_TIMEOUT)` with 
`watcher.waitForDisconnected(5000)` which is a better way to detect if we have 
been disconnected.

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

$ git pull https://github.com/afine/zookeeper ZOOKEEPER-2786_br3.5

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

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

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

This closes #259






> Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode
> --
>
> Key: ZOOKEEPER-2786
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2786
> Project: ZooKeeper
>  Issue Type: Bug
>Affects Versions: 3.4.10, 3.5.3
>Reporter: Abraham Fine
>Assignee: Abraham Fine
>
> This test is broken on 3.4 and 3.5, but is broken in "different" ways. Please 
> see the individual pull requests for detailed descriptions for the issues 
> faced in both branches.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #259: ZOOKEEPER-2786: Flaky test: org.apache.zookeepe...

2017-05-19 Thread afine
GitHub user afine opened a pull request:

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

ZOOKEEPER-2786: Flaky test: 
org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

On branch 3.5, testNonExistingOpCode appears to always take 30 seconds to 
execute (far too long): 
https://builds.apache.org/job/ZooKeeper_branch35_jdk7/967/testReport/org.apache.zookeeper.test/ClientTest/testNonExistingOpCode/history/

The reason for this is a call to 
`zk.testableWaitForShutdown(CONNECTION_TIMEOUT)` while waiting for the client 
to disconnect after it sent a request with a bad opcode to the server. The call 
to `testableWaitForShutdown` never actually asserts anything and effectively 
just hangs for CONNECTION_TIMEOUT (30 seconds) and returns because the client 
reconnects to the server. 

This patch replaces `zk.testableWaitForShutdown(CONNECTION_TIMEOUT)` with 
`watcher.waitForDisconnected(5000)` which is a better way to detect if we have 
been disconnected.

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

$ git pull https://github.com/afine/zookeeper ZOOKEEPER-2786_br3.5

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

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

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

This closes #259






---
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] [Updated] (ZOOKEEPER-2786) Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

2017-05-19 Thread Abraham Fine (JIRA)

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

Abraham Fine updated ZOOKEEPER-2786:

Description: 
This test is broken on 3.4 and 3.5, but is broken in "different" ways. Please 
see the individual pull requests for detailed descriptions for the issues faced 
in both branches.



> Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode
> --
>
> Key: ZOOKEEPER-2786
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2786
> Project: ZooKeeper
>  Issue Type: Bug
>Affects Versions: 3.4.10, 3.5.3
>Reporter: Abraham Fine
>Assignee: Abraham Fine
>
> This test is broken on 3.4 and 3.5, but is broken in "different" ways. Please 
> see the individual pull requests for detailed descriptions for the issues 
> faced in both branches.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (ZOOKEEPER-2786) Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

2017-05-19 Thread Abraham Fine (JIRA)

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

Abraham Fine updated ZOOKEEPER-2786:

Affects Version/s: 3.5.3

> Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode
> --
>
> Key: ZOOKEEPER-2786
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2786
> Project: ZooKeeper
>  Issue Type: Bug
>Affects Versions: 3.4.10, 3.5.3
>Reporter: Abraham Fine
>Assignee: Abraham Fine
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2763) Utils.toCsvBuffer() omits leading 0 for bytes < 0x10

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

Github user eribeiro commented on the issue:

https://github.com/apache/zookeeper/pull/238
  
Also, loops like the one below:
```
for (int idx = 0; idx < s.length(); idx++) {
  char ch = s.charAt(idx);
```
could be simplified to  `for (char ch : s.toCharArray()) {` in some **very 
specific methods that don't increment the counter inside the loop**.




> Utils.toCsvBuffer() omits leading 0 for bytes < 0x10
> 
>
> Key: ZOOKEEPER-2763
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2763
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: jute
>Affects Versions: 3.5.2
>Reporter: Brandon Berg
>Assignee: Alburt Hoffman
>Priority: Minor
>
> org.apache.jute.Utils.toCsvBuffer(), which converts a byte array to a string 
> containing the hex representation of that byte array, omits the leading zero 
> for any byte less than 0x10, due to its use of Integer.toHexString, which has 
> the same behavior.
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/jute/Utils.java#L234
> One consequence of this is that the hex strings printed by 
> ClientCnxn.Packet.toString(), used in the debug logging for 
> ClientCnxn.readResponse(), cannot be parsed to determine the result of a 
> Zookeeper request from client debug logs.
> Utils.toXmlBuffer() appears to have the same issue.
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper issue #238: ZOOKEEPER-2763: Utils.toCsvBuffer() omits leading 0 fo...

2017-05-19 Thread eribeiro
Github user eribeiro commented on the issue:

https://github.com/apache/zookeeper/pull/238
  
Also, loops like the one below:
```
for (int idx = 0; idx < s.length(); idx++) {
  char ch = s.charAt(idx);
```
could be simplified to  `for (char ch : s.toCharArray()) {` in some **very 
specific methods that don't increment the counter inside the loop**.




---
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-2763) Utils.toCsvBuffer() omits leading 0 for bytes < 0x10

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

Github user eribeiro commented on the issue:

https://github.com/apache/zookeeper/pull/238
  
@alburthoffman @afine Hey guys, did you notice that the body of `bufEquals` 
method could be replaced by  `return Arrays.equals(onearray, twoarray);`? 

In fact, the current implementation of `bufEquals` is almost a clone of 
`Arrays.equals`


> Utils.toCsvBuffer() omits leading 0 for bytes < 0x10
> 
>
> Key: ZOOKEEPER-2763
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2763
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: jute
>Affects Versions: 3.5.2
>Reporter: Brandon Berg
>Assignee: Alburt Hoffman
>Priority: Minor
>
> org.apache.jute.Utils.toCsvBuffer(), which converts a byte array to a string 
> containing the hex representation of that byte array, omits the leading zero 
> for any byte less than 0x10, due to its use of Integer.toHexString, which has 
> the same behavior.
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/jute/Utils.java#L234
> One consequence of this is that the hex strings printed by 
> ClientCnxn.Packet.toString(), used in the debug logging for 
> ClientCnxn.readResponse(), cannot be parsed to determine the result of a 
> Zookeeper request from client debug logs.
> Utils.toXmlBuffer() appears to have the same issue.
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper issue #238: ZOOKEEPER-2763: Utils.toCsvBuffer() omits leading 0 fo...

2017-05-19 Thread eribeiro
Github user eribeiro commented on the issue:

https://github.com/apache/zookeeper/pull/238
  
@alburthoffman @afine Hey guys, did you notice that the body of `bufEquals` 
method could be replaced by  `return Arrays.equals(onearray, twoarray);`? 

In fact, the current implementation of `bufEquals` is almost a clone of 
`Arrays.equals`


---
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] [Updated] (ZOOKEEPER-2786) Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

2017-05-19 Thread Abraham Fine (JIRA)

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

Abraham Fine updated ZOOKEEPER-2786:

Affects Version/s: 3.4.10

> Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode
> --
>
> Key: ZOOKEEPER-2786
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2786
> Project: ZooKeeper
>  Issue Type: Bug
>Affects Versions: 3.4.10
>Reporter: Abraham Fine
>Assignee: Abraham Fine
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Created] (ZOOKEEPER-2786) Flaky test: org.apache.zookeeper.test.ClientTest.testNonExistingOpCode

2017-05-19 Thread Abraham Fine (JIRA)
Abraham Fine created ZOOKEEPER-2786:
---

 Summary: Flaky test: 
org.apache.zookeeper.test.ClientTest.testNonExistingOpCode
 Key: ZOOKEEPER-2786
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2786
 Project: ZooKeeper
  Issue Type: Bug
Reporter: Abraham Fine
Assignee: Abraham Fine






--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2763) Utils.toCsvBuffer() omits leading 0 for bytes < 0x10

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/238#discussion_r117538863
  
--- Diff: src/java/main/org/apache/jute/Utils.java ---
@@ -190,19 +190,32 @@ static String fromCSVString(String s) throws 
IOException {
 }
 
 /**
+ * convert byte array to a string in hex format
  * 
- * @param s 
- * @return 
+ * @param barr
+ * @return
  */
-static String toXMLBuffer(byte barr[]) {
--- End diff --

I went through the links that you provided. Would you mind including the 
version of the JVM that you are running? According to 
https://issues.apache.org/jira/browse/CAMEL-4893 the issue I think you are 
running into was fixed in JDK's greater than 1.7.0_02.

It would also be great if you could include a stack trace of the issue you 
are running into.


> Utils.toCsvBuffer() omits leading 0 for bytes < 0x10
> 
>
> Key: ZOOKEEPER-2763
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2763
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: jute
>Affects Versions: 3.5.2
>Reporter: Brandon Berg
>Assignee: Alburt Hoffman
>Priority: Minor
>
> org.apache.jute.Utils.toCsvBuffer(), which converts a byte array to a string 
> containing the hex representation of that byte array, omits the leading zero 
> for any byte less than 0x10, due to its use of Integer.toHexString, which has 
> the same behavior.
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/jute/Utils.java#L234
> One consequence of this is that the hex strings printed by 
> ClientCnxn.Packet.toString(), used in the debug logging for 
> ClientCnxn.readResponse(), cannot be parsed to determine the result of a 
> Zookeeper request from client debug logs.
> Utils.toXmlBuffer() appears to have the same issue.
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #238: ZOOKEEPER-2763: Utils.toCsvBuffer() omits leadi...

2017-05-19 Thread afine
Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/238#discussion_r117538863
  
--- Diff: src/java/main/org/apache/jute/Utils.java ---
@@ -190,19 +190,32 @@ static String fromCSVString(String s) throws 
IOException {
 }
 
 /**
+ * convert byte array to a string in hex format
  * 
- * @param s 
- * @return 
+ * @param barr
+ * @return
  */
-static String toXMLBuffer(byte barr[]) {
--- End diff --

I went through the links that you provided. Would you mind including the 
version of the JVM that you are running? According to 
https://issues.apache.org/jira/browse/CAMEL-4893 the issue I think you are 
running into was fixed in JDK's greater than 1.7.0_02.

It would also be great if you could include a stack trace of the issue you 
are running into.


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117441737
  
--- Diff: src/java/test/org/apache/zookeeper/test/CnxManagerTest.java ---
@@ -351,15 +351,55 @@ public void testSocketTimeout() throws Exception {
 LOG.info("Election port: " + port);
 Thread.sleep(1000);
 
-Socket sock = new Socket();
-sock.connect(peers.get(1L).electionAddr, 5000);
-long begin = Time.currentElapsedTime();
-// Read without sending data. Verify timeout.
-cnxManager.receiveConnection(sock);
-long end = Time.currentElapsedTime();
-if((end - begin) > ((peer.getSyncLimit() * peer.getTickTime()) + 
500)) Assert.fail("Waited more than necessary");
-cnxManager.halt();
-Assert.assertFalse(cnxManager.listener.isAlive());
+try (Socket sock = new Socket()) {
--- End diff --

It looks like the reason for changing those lines was to include a ARM 
block, right?

I understand the motivation and have to refrain myself from doing the same 
a couple of times, but this kind of refactoring would be goal of a separate 
issue as **it is not related to the bug/feature of this issue** (aka _don't fix 
if it's not broken_).

So, it revert it to the original one, please. :)



> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117530984
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -677,6 +686,7 @@ public void run() {
 LOG.debug("Error closing server socket", ie);
 }
 }
+if (ce !=null) throw new RuntimeException(ce);
--- End diff --

Okay, I am still unsure if throwing a Runtime exception is the best 
approach here.


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117527100
  
--- Diff: src/java/test/org/apache/zookeeper/test/CnxManagerTest.java ---
@@ -351,15 +351,55 @@ public void testSocketTimeout() throws Exception {
 LOG.info("Election port: " + port);
 Thread.sleep(1000);
 
-Socket sock = new Socket();
-sock.connect(peers.get(1L).electionAddr, 5000);
-long begin = Time.currentElapsedTime();
-// Read without sending data. Verify timeout.
-cnxManager.receiveConnection(sock);
-long end = Time.currentElapsedTime();
-if((end - begin) > ((peer.getSyncLimit() * peer.getTickTime()) + 
500)) Assert.fail("Waited more than necessary");
-cnxManager.halt();
-Assert.assertFalse(cnxManager.listener.isAlive());
+try (Socket sock = new Socket()) {
+sock.connect(peers.get(1L).electionAddr, 5000);
+long begin = Time.currentElapsedTime();
+// Read without sending data. Verify timeout.
+cnxManager.receiveConnection(sock);
+long end = Time.currentElapsedTime();
+if ((end - begin) > ((peer.getSyncLimit() * 
peer.getTickTime()) + 500))
+Assert.fail("Waited more than necessary");
+cnxManager.halt();
+Assert.assertFalse(cnxManager.listener.isAlive());
+}
+}
+
+/*
+ * Test if a duplicate SID appears in the cluster
+ */
+@Test
+public void testSameSID() throws Exception {
+QuorumPeer peer = new QuorumPeer(peers, peerTmpdir[2], 
peerTmpdir[2], peerClientPort[2], 3, 2, 2000, 2, 2);
+QuorumCnxManager cnxManager = new QuorumCnxManager(peer);
+QuorumCnxManager.Listener listener = cnxManager.listener;
+if (listener != null) {
+Thread.UncaughtExceptionHandler handler = new 
Thread.UncaughtExceptionHandler() {
+@Override
+public void uncaughtException(Thread th, Throwable ex) {
+if (ex instanceof RuntimeException) {
+String msg = ex.getMessage();
+LOG.error(msg);
+
Assert.assertEquals("org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException:"
 +
+" Appearing duplicate SID: 2", msg);
+}
+}
+};
+listener.setUncaughtExceptionHandler(handler);
+listener.start();
+} else {
+LOG.error("Null listener when initializing cnx manager");
+}
+try (Socket sock = new Socket()) {
+InetSocketAddress electionAddr = 
peers.get(peer.getId()).electionAddr;
+LOG.info("Creating socket connection, host: {}, port: {}",
+electionAddr.getHostString(), electionAddr.getPort());
+sock.connect(electionAddr, 3);
--- End diff --

The timeout here is way to big (3 ms) with relation to the other tests 
(5000 ms).


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117407300
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -657,9 +663,12 @@ public void run() {
 LOG.error("Error closing server socket", ie);
 } catch (InterruptedException ie) {
 LOG.error("Interrupted while sleeping. " +
-"Ignoring exception", ie);
+"Ignoring exception", ie);
 }
 closeSocket(client);
+} catch (ConfigException e) {
+LOG.error(e.getMessage());
+ce = e;
--- End diff --

:+1: BUT you need to call `closeSocket(client);` here too. See line 668. ;) 
It is the ServerSocket and Socket we need to close in case of error. I know we 
close the socket previously before throwing the exception, but `Socket#close()` 
is idempotent so, I would advise to put it here too. In fact, we could remove 
line 668 and add a `finally` block with the  `closeSocket(client);` after line 
672.

**Most important!** The latest change doesn't break the while loop so it 
only leave after reaching the maximum number of retries or shutdown is called 
(I bet the first). We should include a `break;` at line 672. ;)



> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117528337
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -310,8 +311,8 @@ public boolean initiateConnection(Socket sock, Long 
sid) {
  * possible long value to lose the challenge.
  *
  */
-public void receiveConnection(Socket sock) {
-Long sid = null, protocolVersion = null;
+public void receiveConnection(Socket sock) throws ConfigException {
+Long sid, protocolVersion;
--- End diff --

As we removed the extraneous `null` here we could also use the primitive 
long type, right? I don't see any gain of using boxed types here. I see a lot 
of boxing/unboxing down in this method, so it could be simply `int sid, 
protocolVersion;` (this slightly falls into "the don't fix if..." adage, but we 
can ignore this for once ;) ).


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread eribeiro
Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117527100
  
--- Diff: src/java/test/org/apache/zookeeper/test/CnxManagerTest.java ---
@@ -351,15 +351,55 @@ public void testSocketTimeout() throws Exception {
 LOG.info("Election port: " + port);
 Thread.sleep(1000);
 
-Socket sock = new Socket();
-sock.connect(peers.get(1L).electionAddr, 5000);
-long begin = Time.currentElapsedTime();
-// Read without sending data. Verify timeout.
-cnxManager.receiveConnection(sock);
-long end = Time.currentElapsedTime();
-if((end - begin) > ((peer.getSyncLimit() * peer.getTickTime()) + 
500)) Assert.fail("Waited more than necessary");
-cnxManager.halt();
-Assert.assertFalse(cnxManager.listener.isAlive());
+try (Socket sock = new Socket()) {
+sock.connect(peers.get(1L).electionAddr, 5000);
+long begin = Time.currentElapsedTime();
+// Read without sending data. Verify timeout.
+cnxManager.receiveConnection(sock);
+long end = Time.currentElapsedTime();
+if ((end - begin) > ((peer.getSyncLimit() * 
peer.getTickTime()) + 500))
+Assert.fail("Waited more than necessary");
+cnxManager.halt();
+Assert.assertFalse(cnxManager.listener.isAlive());
+}
+}
+
+/*
+ * Test if a duplicate SID appears in the cluster
+ */
+@Test
+public void testSameSID() throws Exception {
+QuorumPeer peer = new QuorumPeer(peers, peerTmpdir[2], 
peerTmpdir[2], peerClientPort[2], 3, 2, 2000, 2, 2);
+QuorumCnxManager cnxManager = new QuorumCnxManager(peer);
+QuorumCnxManager.Listener listener = cnxManager.listener;
+if (listener != null) {
+Thread.UncaughtExceptionHandler handler = new 
Thread.UncaughtExceptionHandler() {
+@Override
+public void uncaughtException(Thread th, Throwable ex) {
+if (ex instanceof RuntimeException) {
+String msg = ex.getMessage();
+LOG.error(msg);
+
Assert.assertEquals("org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException:"
 +
+" Appearing duplicate SID: 2", msg);
+}
+}
+};
+listener.setUncaughtExceptionHandler(handler);
+listener.start();
+} else {
+LOG.error("Null listener when initializing cnx manager");
+}
+try (Socket sock = new Socket()) {
+InetSocketAddress electionAddr = 
peers.get(peer.getId()).electionAddr;
+LOG.info("Creating socket connection, host: {}, port: {}",
+electionAddr.getHostString(), electionAddr.getPort());
+sock.connect(electionAddr, 3);
--- End diff --

The timeout here is way to big (3 ms) with relation to the other tests 
(5000 ms).


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117529199
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -371,6 +372,10 @@ public void receiveConnection(Socket sock) {
 connectOne(sid);
 }
 
+}else if (sid == self.getId()) {
--- End diff --

nit: space between `{` and `else`


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread eribeiro
Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117529199
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -371,6 +372,10 @@ public void receiveConnection(Socket sock) {
 connectOne(sid);
 }
 
+}else if (sid == self.getId()) {
--- End diff --

nit: space between `{` and `else`


---
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-2784) Add some limitations on code level for `SID` to avoid configuration problem

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/257#discussion_r117529736
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
@@ -545,6 +545,7 @@ public void testInconsistentPeerType() throws Exception 
{
 defaultedToObserver = true;
 }
 if (warningPresent && defaultedToObserver) {
+LOG.debug("Content from console is: {}", line);
--- End diff --

Ugh?! What is the purpose of this for the issue at hand?


> Add some limitations on code level for `SID` to avoid configuration problem
> ---
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: quorum
>Affects Versions: 3.5.2
>Reporter: Benedict Jin
> Fix For: 3.6.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same 
> `SID` problem, then the Zookeeper cluster will start successfully. But the 
> cluster is not health, and it will throw some problem like `not 
> synchronized`. So, i thought we should add some limitations on code level for 
> `SID` to find those configuration problem more early.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread eribeiro
Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117529736
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
@@ -545,6 +545,7 @@ public void testInconsistentPeerType() throws Exception 
{
 defaultedToObserver = true;
 }
 if (warningPresent && defaultedToObserver) {
+LOG.debug("Content from console is: {}", line);
--- End diff --

Ugh?! What is the purpose of this for the issue at hand?


---
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 #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread eribeiro
Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117441737
  
--- Diff: src/java/test/org/apache/zookeeper/test/CnxManagerTest.java ---
@@ -351,15 +351,55 @@ public void testSocketTimeout() throws Exception {
 LOG.info("Election port: " + port);
 Thread.sleep(1000);
 
-Socket sock = new Socket();
-sock.connect(peers.get(1L).electionAddr, 5000);
-long begin = Time.currentElapsedTime();
-// Read without sending data. Verify timeout.
-cnxManager.receiveConnection(sock);
-long end = Time.currentElapsedTime();
-if((end - begin) > ((peer.getSyncLimit() * peer.getTickTime()) + 
500)) Assert.fail("Waited more than necessary");
-cnxManager.halt();
-Assert.assertFalse(cnxManager.listener.isAlive());
+try (Socket sock = new Socket()) {
--- End diff --

It looks like the reason for changing those lines was to include a ARM 
block, right?

I understand the motivation and have to refrain myself from doing the same 
a couple of times, but this kind of refactoring would be goal of a separate 
issue as **it is not related to the bug/feature of this issue** (aka _don't fix 
if it's not broken_).

So, it revert it to the original one, please. :)



---
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 #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread eribeiro
Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117530984
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -677,6 +686,7 @@ public void run() {
 LOG.debug("Error closing server socket", ie);
 }
 }
+if (ce !=null) throw new RuntimeException(ce);
--- End diff --

Okay, I am still unsure if throwing a Runtime exception is the best 
approach here.


---
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 #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread eribeiro
Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117528337
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -310,8 +311,8 @@ public boolean initiateConnection(Socket sock, Long 
sid) {
  * possible long value to lose the challenge.
  *
  */
-public void receiveConnection(Socket sock) {
-Long sid = null, protocolVersion = null;
+public void receiveConnection(Socket sock) throws ConfigException {
+Long sid, protocolVersion;
--- End diff --

As we removed the extraneous `null` here we could also use the primitive 
long type, right? I don't see any gain of using boxed types here. I see a lot 
of boxing/unboxing down in this method, so it could be simply `int sid, 
protocolVersion;` (this slightly falls into "the don't fix if..." adage, but we 
can ignore this for once ;) ).


---
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 #257: ZOOKEEPER-2784: Add same `sid` config problem c...

2017-05-19 Thread eribeiro
Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/257#discussion_r117407300
  
--- Diff: 
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -657,9 +663,12 @@ public void run() {
 LOG.error("Error closing server socket", ie);
 } catch (InterruptedException ie) {
 LOG.error("Interrupted while sleeping. " +
-"Ignoring exception", ie);
+"Ignoring exception", ie);
 }
 closeSocket(client);
+} catch (ConfigException e) {
+LOG.error(e.getMessage());
+ce = e;
--- End diff --

:+1: BUT you need to call `closeSocket(client);` here too. See line 668. ;) 
It is the ServerSocket and Socket we need to close in case of error. I know we 
close the socket previously before throwing the exception, but `Socket#close()` 
is idempotent so, I would advise to put it here too. In fact, we could remove 
line 668 and add a `finally` block with the  `closeSocket(client);` after line 
672.

**Most important!** The latest change doesn't break the while loop so it 
only leave after reaching the maximum number of retries or shutdown is called 
(I bet the first). We should include a `break;` at line 672. ;)



---
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 issue #167: commitProcessor does not crash when an unseen commit s...

2017-05-19 Thread hanm
Github user hanm commented on the issue:

https://github.com/apache/zookeeper/pull/167
  
noCrashOnCommittedRequestsOfUnSeenRequestTest is failing here, please 
investigate.

https://builds.apache.org/job/ZooKeeper_UT_StressTest/4152/testReport/junit/org.apache.zookeeper.server.quorum/CommitProcessorConcurrencyTest/noCrashOnCommittedRequestsOfUnSeenRequestTest/

(This is a Jenkins job I set up to stress test unit test for specific pull 
request branch).


---
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_branch34_openjdk7 - Build # 1502 - Still Failing

2017-05-19 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper_branch34_openjdk7/1502/

###
## LAST 60 LINES OF THE CONSOLE 
###
Started by timer
[EnvInject] - Loading node environment variables.
Building remotely on qnode1 (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 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 3c4f01f6450f55d2fcc605f66c6c6584ccff1584 
(refs/remotes/origin/branch-3.4)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 3c4f01f6450f55d2fcc605f66c6c6584ccff1584
 > git rev-list 3c4f01f6450f55d2fcc605f66c6c6584ccff1584 # timeout=10
No emails were triggered.
[ZooKeeper_branch34_openjdk7] $ 
/home/jenkins/tools/ant/apache-ant-1.9.9/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_branch35_jdk7 - Build # 968 - Failure

2017-05-19 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper_branch35_jdk7/968/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 65.36 MB...]
[junit] at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[junit] at java.lang.Thread.run(Thread.java:745)
[junit] 2017-05-19 08:50:58,981 [myid:] - WARN  [New I/O boss 
#34:ClientCnxnSocketNetty$ZKClientHandler@439] - Exception caught: [id: 
0xd63e4941] EXCEPTION: java.net.ConnectException: Connection refused: 
127.0.0.1/127.0.0.1:16608
[junit] java.net.ConnectException: Connection refused: 
127.0.0.1/127.0.0.1:16608
[junit] at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
[junit] at 
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744)
[junit] at 
org.jboss.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:152)
[junit] at 
org.jboss.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105)
[junit] at 
org.jboss.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:79)
[junit] at 
org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
[junit] at 
org.jboss.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)
[junit] at 
org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
[junit] at 
org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
[junit] at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[junit] at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[junit] at java.lang.Thread.run(Thread.java:745)
[junit] 2017-05-19 08:50:58,981 [myid:] - INFO  [New I/O boss 
#34:ClientCnxnSocketNetty@208] - channel is told closing
[junit] 2017-05-19 08:50:58,981 [myid:127.0.0.1:16608] - INFO  
[main-SendThread(127.0.0.1:16608):ClientCnxn$SendThread@1231] - channel for 
sessionid 0x1039950e135 is lost, closing socket connection and attempting 
reconnect
[junit] 2017-05-19 08:50:59,057 [myid:] - INFO  [ProcessThread(sid:0 
cport:16854)::PrepRequestProcessor@613] - Processed session termination for 
sessionid: 0x1039958947b
[junit] 2017-05-19 08:50:59,060 [myid:] - INFO  
[SyncThread:0:MBeanRegistry@128] - Unregister MBean 
[org.apache.ZooKeeperService:name0=StandaloneServer_port16854,name1=Connections,name2=127.0.0.1,name3=0x1039958947b]
[junit] 2017-05-19 08:50:59,061 [myid:] - INFO  
[main:ClientCnxnSocketNetty@208] - channel is told closing
[junit] 2017-05-19 08:50:59,061 [myid:] - INFO  
[main-EventThread:ClientCnxn$EventThread@513] - EventThread shut down for 
session: 0x1039958947b
[junit] 2017-05-19 08:50:59,061 [myid:] - INFO  [New I/O worker 
#8334:ClientCnxnSocketNetty$ZKClientHandler@384] - channel is disconnected: 
[id: 0x8c2a2b08, /127.0.0.1:38448 :> 127.0.0.1/127.0.0.1:16854]
[junit] 2017-05-19 08:50:59,061 [myid:] - INFO  [New I/O worker 
#8334:ClientCnxnSocketNetty@208] - channel is told closing
[junit] 2017-05-19 08:50:59,061 [myid:] - INFO  [main:ZooKeeper@1331] - 
Session: 0x1039958947b closed
[junit] 2017-05-19 08:50:59,062 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@82] - Memory used 113771
[junit] 2017-05-19 08:50:59,062 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@87] - Number of threads 948
[junit] 2017-05-19 08:50:59,062 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@102] - FINISHED TEST METHOD 
testWatcherAutoResetWithLocal
[junit] 2017-05-19 08:50:59,062 [myid:] - INFO  [main:ClientBase@567] - 
tearDown starting
[junit] 2017-05-19 08:50:59,063 [myid:] - INFO  [main:ClientBase@537] - 
STOPPING server
[junit] 2017-05-19 08:50:59,063 [myid:] - INFO  
[main:NettyServerCnxnFactory@464] - shutdown called 0.0.0.0/0.0.0.0:16854
[junit] 2017-05-19 08:50:59,065 [myid:] - INFO  [main:ZooKeeperServer@541] 
- shutting down
[junit] 2017-05-19 08:50:59,065 [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-05-19 08:50:59,065 [myid:] - INFO  
[main:SessionTrackerImpl@232] - Shutting down
[junit] 2017-05-19 08:50:59,066 [myid:] - INFO  
[main:PrepRequestProcessor@1004] - Shutting down
[junit] 2017-05-19 08:50:59,066 [myid:] - INFO  
[main:SyncRequestProcessor@191] - Shutting down
[junit] 2017-05-19 08:50:59,066 [myid:] - INFO  [ProcessThread(sid:0 
cport:16854)::PrepRequestProcessor@156] - PrepRequestProcessor exited loop!
[junit] 2017-05-19 08:50:59,066 [myid:] - INFO  
[SyncThread:0:SyncRequestProcessor@169] - SyncRequestProcessor exited!
[junit] 2017-05-19 

[jira] [Commented] (ZOOKEEPER-2763) Utils.toCsvBuffer() omits leading 0 for bytes < 0x10

2017-05-19 Thread ASF GitHub Bot (JIRA)

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

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

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

https://github.com/apache/zookeeper/pull/238#discussion_r117419956
  
--- Diff: src/java/main/org/apache/jute/Utils.java ---
@@ -190,19 +190,32 @@ static String fromCSVString(String s) throws 
IOException {
 }
 
 /**
+ * convert byte array to a string in hex format
  * 
- * @param s 
- * @return 
+ * @param barr
+ * @return
  */
-static String toXMLBuffer(byte barr[]) {
--- End diff --

I'm not able to dig into Zookeeper internal to find the root cause.
but this link would help:

http://stackoverflow.com/questions/12498256/why-the-npe-using-static-method-of-datatypeconverter

https://developer.ibm.com/answers/questions/200553/jaxb-datatypeconverter-throws-nullpointerexception.html



> Utils.toCsvBuffer() omits leading 0 for bytes < 0x10
> 
>
> Key: ZOOKEEPER-2763
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2763
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: jute
>Affects Versions: 3.5.2
>Reporter: Brandon Berg
>Assignee: Alburt Hoffman
>Priority: Minor
>
> org.apache.jute.Utils.toCsvBuffer(), which converts a byte array to a string 
> containing the hex representation of that byte array, omits the leading zero 
> for any byte less than 0x10, due to its use of Integer.toHexString, which has 
> the same behavior.
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/jute/Utils.java#L234
> One consequence of this is that the hex strings printed by 
> ClientCnxn.Packet.toString(), used in the debug logging for 
> ClientCnxn.readResponse(), cannot be parsed to determine the result of a 
> Zookeeper request from client debug logs.
> Utils.toXmlBuffer() appears to have the same issue.
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #238: ZOOKEEPER-2763: Utils.toCsvBuffer() omits leadi...

2017-05-19 Thread alburthoffman
Github user alburthoffman commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/238#discussion_r117419956
  
--- Diff: src/java/main/org/apache/jute/Utils.java ---
@@ -190,19 +190,32 @@ static String fromCSVString(String s) throws 
IOException {
 }
 
 /**
+ * convert byte array to a string in hex format
  * 
- * @param s 
- * @return 
+ * @param barr
+ * @return
  */
-static String toXMLBuffer(byte barr[]) {
--- End diff --

I'm not able to dig into Zookeeper internal to find the root cause.
but this link would help:

http://stackoverflow.com/questions/12498256/why-the-npe-using-static-method-of-datatypeconverter

https://developer.ibm.com/answers/questions/200553/jaxb-datatypeconverter-throws-nullpointerexception.html



---
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.
---